1
0
Fork 0
mirror of synced 2024-12-22 14:11:07 -05:00

Add test for conditional linking

This commit is contained in:
Anish Athalye 2018-10-16 20:22:50 -04:00
parent a9cf9fffe4
commit b0ce63904c

View file

@ -1,2 +1,32 @@
test_description='link if'
. '../test-lib.bash'
test_expect_success 'setup' '
mkdir ~/d
echo "apple" > ${DOTFILES}/f
'
test_expect_success 'run' '
run_dotbot <<EOF
- link:
~/.f:
path: f
if: "true"
~/.g:
path: f
if: "false"
~/.h:
path: f
if: "[[ -d ~/d ]]"
~/.i:
path: f
if: "badcommand"
EOF
'
test_expect_success 'test' '
grep "apple" ~/.f &&
! test -f ~/.g &&
grep "apple" ~/.h &&
! test -f ~/.i
'