1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-11-21 20:35:10 +00:00

Add help tests to list.bats.

This commit is contained in:
William Melody 2016-01-26 19:00:02 -08:00
parent 09c375633f
commit 07108dc706

View File

@ -42,3 +42,18 @@ Disabled:
_compare "'$_expected'" "'$output'"
[[ "$output" == "$_expected" ]]
}
# help ########################################################################
@test "\`help list\` exits with status 0." {
run "$_HOSTS" help list
[[ $status -eq 0 ]]
}
@test "\`help list\` prints help information." {
run "$_HOSTS" help list
printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts list [enabled | disabled | <search string>]" ]]
}