From 07108dc706b40618ecc63722a5a39e15af67ccc7 Mon Sep 17 00:00:00 2001 From: William Melody Date: Tue, 26 Jan 2016 19:00:02 -0800 Subject: [PATCH] Add help tests to list.bats. --- test/list.bats | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/list.bats b/test/list.bats index fd352bd..7842280 100644 --- a/test/list.bats +++ b/test/list.bats @@ -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 | ]" ]] +}