diff --git a/test/file.bats b/test/file.bats index 8806f58..b907112 100644 --- a/test/file.bats +++ b/test/file.bats @@ -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" ]] +}