summaryrefslogtreecommitdiff
path: root/test/tests/only.bash
diff options
context:
space:
mode:
Diffstat (limited to 'test/tests/only.bash')
-rw-r--r--test/tests/only.bash31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/tests/only.bash b/test/tests/only.bash
new file mode 100644
index 0000000..5222881
--- /dev/null
+++ b/test/tests/only.bash
@@ -0,0 +1,31 @@
+test_description='--only'
+. '../test-lib.bash'
+
+test_expect_success 'setup' '
+echo "apple" > ${DOTFILES}/x
+'
+
+test_expect_success 'run' '
+run_dotbot --only shell <<EOF
+- shell:
+ - echo "pear" > ~/y
+- link:
+ ~/x: x
+EOF
+'
+
+test_expect_success 'test' '
+grep "pear" ~/y && ! test -f ~/x
+'
+
+test_expect_success 'run 2' '
+run_dotbot --only link <<EOF
+- shell:
+ - echo "pear" > ~/z
+- link:
+ ~/x: x
+'
+
+test_expect_success 'test' '
+grep "apple" ~/x && ! test -f ~/z
+'