From f30981ec80ad33b42342895e2d921ab1c9c09bbf Mon Sep 17 00:00:00 2001 From: William Melody Date: Tue, 26 Jan 2016 19:05:10 -0800 Subject: [PATCH] Add help tests to enabled.bats. --- test/enabled.bats | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/enabled.bats b/test/enabled.bats index 8c5e61e..8d50741 100644 --- a/test/enabled.bats +++ b/test/enabled.bats @@ -35,3 +35,18 @@ load test_helper [[ "${lines[3]}" == "fe80::1%lo0 localhost" ]] [[ "${lines[4]}" == "127.0.0.2 example.com" ]] } + +# help ######################################################################## + +@test "\`help enabled\` exits with status 0." { + run "$_HOSTS" help enabled + [[ $status -eq 0 ]] +} + +@test "\`help enabled\` prints help information." { + run "$_HOSTS" help enabled + printf "\$status: %s\n" "$status" + printf "\$output: '%s'\n" "$output" + [[ "${lines[0]}" == "Usage:" ]] + [[ "${lines[1]}" == " hosts enabled" ]] +}