mirror of
https://github.com/octoleo/hosts.git
synced 2024-12-28 20:12:42 +00:00
Add help tests to add.bats.
This commit is contained in:
parent
07108dc706
commit
d88d819a19
@ -110,3 +110,18 @@ load test_helper
|
||||
[[ "${lines[0]}" == "Added:" ]]
|
||||
[[ "${lines[1]}" == "0.0.0.0 example.com # Comment." ]]
|
||||
}
|
||||
|
||||
# help ########################################################################
|
||||
|
||||
@test "\`help add\` exits with status 0." {
|
||||
run "$_HOSTS" help add
|
||||
[[ $status -eq 0 ]]
|
||||
}
|
||||
|
||||
@test "\`help add\` prints help information." {
|
||||
run "$_HOSTS" help add
|
||||
printf "\$status: %s\n" "$status"
|
||||
printf "\$output: '%s'\n" "$output"
|
||||
[[ "${lines[0]}" == "Usage:" ]]
|
||||
[[ "${lines[1]}" == " hosts add <ip> <hostname> [comment]" ]]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user