summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2016-03-02 20:53:19 -0500
committerAnish Athalye <me@anishathalye.com>2016-03-03 09:42:50 -0500
commitf52bbd1eec0d6fb103c5fcbb75c03ca223fffdb7 (patch)
tree8578282f6ce6cdb02eab51a9bcd18c590f7a127a /test
parentdaf8d82e02c2bcc476932790fa25076631c4c312 (diff)
Add default options
This feature was implemented with feedback from Aleks Kamko <aykamko@gmail.com> and Casey Rodarmor <casey@rodarmor.com>.
Diffstat (limited to 'test')
-rw-r--r--test/tests/defaults.bash34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/tests/defaults.bash b/test/tests/defaults.bash
new file mode 100644
index 0000000..595f950
--- /dev/null
+++ b/test/tests/defaults.bash
@@ -0,0 +1,34 @@
+test_description='defaults setting works'
+. '../test-lib.bash'
+
+test_expect_success 'setup' '
+echo "apple" > ${DOTFILES}/f &&
+echo "grape" > ~/f &&
+ln -s ~/f ~/.f
+'
+
+test_expect_failure 'run-fail' '
+run_dotbot <<EOF
+- link:
+ ~/.f: f
+EOF
+'
+
+test_expect_failure 'test-fail' '
+grep "apple" ~/.f
+'
+
+test_expect_success 'run' '
+run_dotbot <<EOF
+- defaults:
+ link:
+ relink: true
+
+- link:
+ ~/.f: f
+EOF
+'
+
+test_expect_success 'test' '
+grep "apple" ~/.f
+'