2016-03-02 20:53:19 -05:00
|
|
|
test_description='defaults setting works'
|
|
|
|
. '../test-lib.bash'
|
|
|
|
|
|
|
|
test_expect_success 'setup' '
|
|
|
|
echo "apple" > ${DOTFILES}/f &&
|
|
|
|
echo "grape" > ~/f &&
|
2017-03-22 06:22:10 -04:00
|
|
|
ln -s ~/f ~/.f &&
|
|
|
|
ln -s /nowhere ~/.g
|
2016-03-02 20:53:19 -05:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_failure 'run-fail' '
|
|
|
|
run_dotbot <<EOF
|
|
|
|
- link:
|
|
|
|
~/.f: f
|
|
|
|
EOF
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_failure 'test-fail' '
|
|
|
|
grep "apple" ~/.f
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'run' '
|
|
|
|
run_dotbot <<EOF
|
|
|
|
- defaults:
|
|
|
|
link:
|
|
|
|
relink: true
|
|
|
|
|
|
|
|
- link:
|
|
|
|
~/.f: f
|
|
|
|
EOF
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'test' '
|
|
|
|
grep "apple" ~/.f
|
|
|
|
'
|
2017-03-22 06:22:10 -04:00
|
|
|
|
2017-04-18 22:35:33 -04:00
|
|
|
test_expect_success 'run-fail 2' '
|
2017-03-22 06:22:10 -04:00
|
|
|
run_dotbot <<EOF
|
|
|
|
- clean: ["~"]
|
|
|
|
EOF
|
|
|
|
'
|
|
|
|
|
2017-04-18 22:35:33 -04:00
|
|
|
test_expect_failure 'test-fail 2' '
|
2017-03-22 06:22:10 -04:00
|
|
|
! test -h ~/.g
|
|
|
|
'
|
|
|
|
|
2017-04-18 22:35:33 -04:00
|
|
|
test_expect_success 'run 2' '
|
2017-03-22 06:22:10 -04:00
|
|
|
run_dotbot <<EOF
|
|
|
|
- defaults:
|
|
|
|
clean:
|
|
|
|
force: true
|
|
|
|
|
|
|
|
- clean: ["~"]
|
|
|
|
EOF
|
|
|
|
'
|
|
|
|
|
2017-04-18 22:35:33 -04:00
|
|
|
test_expect_success 'test 2' '
|
2017-03-22 06:22:10 -04:00
|
|
|
! test -h ~/.g
|
|
|
|
'
|