1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-06-01 05:50:54 +00:00

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

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" ]]
}