Add help tests to file.bats.

This commit is contained in:
William Melody 2016-01-26 19:05:47 -08:00
parent f30981ec80
commit abfd442c3d
1 changed files with 15 additions and 0 deletions

View File

@ -11,3 +11,18 @@ load test_helper
run "$_HOSTS" file
[[ "$output" == "$(cat $HOSTS_PATH)" ]]
}
# help ########################################################################
@test "\`help file\` exits with status 0." {
run "$_HOSTS" help file
[[ $status -eq 0 ]]
}
@test "\`help file\` prints help information." {
run "$_HOSTS" help file
printf "\$status: %s\n" "$status"
printf "\$output: '%s'\n" "$output"
[[ "${lines[0]}" == "Usage:" ]]
[[ "${lines[1]}" == " hosts file" ]]
}