1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-12-29 12:32:44 +00:00

Add version.bats.

This commit is contained in:
William Melody 2016-01-25 19:27:49 -08:00
parent 6783e94f16
commit 7c961e1318

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\+'
}