1
0
Fork 0
mirror of synced 2024-11-03 01:28:57 -04:00
yadm/test/100_accept_version.bats
Tim Byrne d2cd3b1b26 Add tests
Tests will be run using `bats`.
2016-04-07 08:14:13 -05:00

22 lines
482 B
Bash

load common
load_fixtures
@test "Command 'version'" {
echo "
When 'version' command is provided,
Print the current version with format 'yadm x.xx'
Exit with 0
"
#; run yadm with 'version' command
run $T_YADM version
#; load yadm variables (including VERSION)
YADM_TEST=1 source $T_YADM
#; validate status and output
[ $status -eq 0 ]
[ "$output" = "yadm $VERSION" ]
version_regex="^yadm [[:digit:]\.]+$"
[[ "$output" =~ $version_regex ]]
}