From 631c295ad17093a57568fdcc019df30a4010fc5b Mon Sep 17 00:00:00 2001 From: William Melody Date: Tue, 26 Jan 2016 19:02:07 -0800 Subject: [PATCH] Add help tests to disable.bats. --- test/disable.bats | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/disable.bats b/test/disable.bats index c7caddb..084fc8f 100644 --- a/test/disable.bats +++ b/test/disable.bats @@ -152,3 +152,18 @@ load test_helper [[ "${lines[0]}" == "Disabling:" ]] [[ "${lines[1]}" == "0.0.0.0 example.com" ]] } + +# help ######################################################################## + +@test "\`help disable\` exits with status 0." { + run "$_HOSTS" help disable + [[ $status -eq 0 ]] +} + +@test "\`help disable\` prints help information." { + run "$_HOSTS" help disable + printf "\$status: %s\n" "$status" + printf "\$output: '%s'\n" "$output" + [[ "${lines[0]}" == "Usage:" ]] + [[ "${lines[1]}" == " hosts disable ( | | )" ]] +}