2016-03-24 00:18:33 +00:00
|
|
|
load common
|
|
|
|
load_fixtures
|
2016-04-06 17:33:42 +00:00
|
|
|
status=;lines=; #; populated by bats run()
|
2016-03-24 00:18:33 +00:00
|
|
|
|
|
|
|
@test "Missing command" {
|
|
|
|
echo "
|
|
|
|
When no command is provided,
|
|
|
|
Produce usage instructions
|
|
|
|
Exit with 1
|
|
|
|
"
|
|
|
|
|
|
|
|
#; run yadm with no command
|
2016-04-06 17:33:42 +00:00
|
|
|
run "$T_YADM"
|
|
|
|
|
2016-03-24 00:18:33 +00:00
|
|
|
#; validate status and output
|
|
|
|
[ $status -eq 1 ]
|
|
|
|
[[ "${lines[0]}" =~ ^Usage: ]]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "Command 'help'" {
|
|
|
|
echo "
|
|
|
|
When 'help' command is provided,
|
|
|
|
Produce usage instructions
|
|
|
|
Exit with value 1
|
|
|
|
"
|
|
|
|
|
|
|
|
#; run yadm with 'help' command
|
2016-04-06 17:33:42 +00:00
|
|
|
run "$T_YADM" help
|
2016-03-24 00:18:33 +00:00
|
|
|
|
|
|
|
#; validate status and output
|
|
|
|
[ $status -eq 1 ]
|
|
|
|
[[ "${lines[0]}" =~ ^Usage: ]]
|
|
|
|
}
|