1
0
Fork 0
mirror of synced 2024-11-17 06:45:33 -05:00
yadm/test/002_unit_yadm_dir.bats
Tim Byrne d2cd3b1b26 Add tests
Tests will be run using `bats`.
2016-04-07 08:14:13 -05:00

31 lines
591 B
Bash

load common
load_fixtures
@test "Default YADM_DIR" {
echo "
YADM_DIR should default to \$HOME/.yadm
"
#; load yadm functions
YADM_TEST=1 source $T_YADM
#; test value of YADM_DIR
[ "$HOME/.yadm" = "$YADM_DIR" ]
}
@test "Override default YADM_DIR" {
echo "
Override YADM_DIR using -Y $T_DIR_YADM
YADM_DIR should become $T_DIR_YADM
"
#; load yadm functions
YADM_TEST=1 source $T_YADM
#; call process_global_args() with -Y
TEST_ARGS=(-Y $T_DIR_YADM)
process_global_args ${TEST_ARGS[*]}
#; test value of YADM_DIR
[ "$T_DIR_YADM" = "$YADM_DIR" ]
}