mirror of
https://github.com/octoleo/hosts.git
synced 2024-11-24 21:57:35 +00:00
Add help tests to enable.bats.
This commit is contained in:
parent
c5fe3aedb2
commit
481e593666
@ -208,3 +208,18 @@ load test_helper
|
|||||||
[[ "${lines[0]}" == "Enabling:" ]]
|
[[ "${lines[0]}" == "Enabling:" ]]
|
||||||
[[ "${lines[1]}" == "0.0.0.0 example.net" ]]
|
[[ "${lines[1]}" == "0.0.0.0 example.net" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# help ########################################################################
|
||||||
|
|
||||||
|
@test "\`help enable\` exits with status 0." {
|
||||||
|
run "$_HOSTS" help enable
|
||||||
|
[[ $status -eq 0 ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "\`help enable\` prints help information." {
|
||||||
|
run "$_HOSTS" help enable
|
||||||
|
printf "\$status: %s\n" "$status"
|
||||||
|
printf "\$output: '%s'\n" "$output"
|
||||||
|
[[ "${lines[0]}" == "Usage:" ]]
|
||||||
|
[[ "${lines[1]}" == " hosts enable ( <ip> | <hostname> | <search string> )" ]]
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user