summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2019-12-31 14:47:32 -0500
committerAnish Athalye <me@anishathalye.com>2019-12-31 14:47:32 -0500
commit81f0d7495518a1fe441343024f2320c95eff86b4 (patch)
treedb8b2a0dcc664f660cbc0898efb7956eeb130408 /test
parenta7bfce3e231d8ce83a7425a13bef692f5162b5be (diff)
Fix clean not respecting defaults
Previously, clean read the defaults once, and then it updated the setting for each entry it read. This resulted in the defaults being clobbered and then not being respected for subsequent entries. This patch fixes the issue by re-reading the defaults before processing each item. The other plugins (link, shell) do not have this problem.
Diffstat (limited to 'test')
-rw-r--r--test/tests/clean-default.bash19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/tests/clean-default.bash b/test/tests/clean-default.bash
new file mode 100644
index 0000000..8bb405d
--- /dev/null
+++ b/test/tests/clean-default.bash
@@ -0,0 +1,19 @@
+test_description='clean uses default unless overridden'
+. '../test-lib.bash'
+
+test_expect_success 'setup' '
+ln -s /nowhere ~/.g
+'
+
+test_expect_success 'run' '
+run_dotbot <<EOF
+- clean:
+ ~/nonexistent:
+ force: true
+ ~/:
+EOF
+'
+
+test_expect_success 'test' '
+test -h ~/.g
+'