Add version.bats.

This commit is contained in:
William Melody 2016-01-25 19:27:49 -08:00
parent 6783e94f16
commit 7c961e1318
1 changed files with 25 additions and 0 deletions

25
test/version.bats Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bats
load test_helper
@test "\`hosts version\` returns with 0 status." {
run "$_HOSTS" --version
[[ "$status" -eq 0 ]]
}
@test "\`hosts version\` prints a version number." {
run "$_HOSTS" --version
printf "'%s'" "$output"
echo "$output" | grep -q '\d\+\.\d\+\.\d\+'
}
@test "\`hosts --version\` returns with 0 status." {
run "$_HOSTS" --version
[[ "$status" -eq 0 ]]
}
@test "\`hosts --version\` prints a version number." {
run "$_HOSTS" --version
printf "'%s'" "$output"
echo "$output" | grep -q '\d\+\.\d\+\.\d\+'
}