mirror of
https://github.com/octoleo/hosts.git
synced 2025-02-11 06:48:27 +00:00
Add help tests to file.bats.
This commit is contained in:
parent
f30981ec80
commit
abfd442c3d
@ -11,3 +11,18 @@ load test_helper
|
|||||||
run "$_HOSTS" file
|
run "$_HOSTS" file
|
||||||
[[ "$output" == "$(cat $HOSTS_PATH)" ]]
|
[[ "$output" == "$(cat $HOSTS_PATH)" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# help ########################################################################
|
||||||
|
|
||||||
|
@test "\`help file\` exits with status 0." {
|
||||||
|
run "$_HOSTS" help file
|
||||||
|
[[ $status -eq 0 ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "\`help file\` prints help information." {
|
||||||
|
run "$_HOSTS" help file
|
||||||
|
printf "\$status: %s\n" "$status"
|
||||||
|
printf "\$output: '%s'\n" "$output"
|
||||||
|
[[ "${lines[0]}" == "Usage:" ]]
|
||||||
|
[[ "${lines[1]}" == " hosts file" ]]
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user