Add test for conditional linking
This commit is contained in:
parent
a9cf9fffe4
commit
b0ce63904c
1 changed files with 30 additions and 0 deletions
|
@ -1,2 +1,32 @@
|
||||||
test_description='link if'
|
test_description='link if'
|
||||||
. '../test-lib.bash'
|
. '../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
|
||||||
|
'
|
||||||
|
|
Loading…
Reference in a new issue