diff options
author | Anish Athalye <me@anishathalye.com> | 2020-03-25 21:38:39 -0400 |
---|---|---|
committer | Anish Athalye <me@anishathalye.com> | 2020-03-26 11:23:07 -0400 |
commit | 7ffaa65482a59fa485e7a8f19fe07a33694fc157 (patch) | |
tree | 78e5990b5934b920b797fe7bace046b3b9bf51c6 /test/tests/only.bash | |
parent | 5d83f9e797b1950199e127a8196803f5e33e0916 (diff) |
Add --only and --except command-line arguments
Internal to Dotbot, we use the name "skip" instead of "except", because
the latter is a keyword, and using a name like "except_" didn't seem as
nice.
Diffstat (limited to 'test/tests/only.bash')
-rw-r--r-- | test/tests/only.bash | 31 |
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 +' |