1
0
Fork 0
mirror of synced 2024-11-17 05:55:34 -05:00
dotbot/test/tests/link-if.bash
2018-10-16 20:22:50 -04:00

32 lines
482 B
Bash

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
'