1
0
mirror of https://github.com/sstephenson/bats.git synced 2026-02-25 17:28:11 +01:00

Initial tests

This commit is contained in:
Sam Stephenson
2011-12-28 16:21:48 -06:00
parent c850527cce
commit b9cfa7470c
4 changed files with 36 additions and 1 deletions

21
test/bats.bats Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bats
FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures"
@test "running 'bats' with no arguments prints usage instructions" {
run bats
[[ $status -eq 1 ]]
[[ $output =~ ^usage: ]]
}
@test "running 'bats' with an invalid filename prints an error" {
run bats nonexistent
[[ $status -eq 1 ]]
[[ $output =~ does\ not\ exist ]]
}
@test "running 'bats' with an empty test file runs zero tests" {
run bats "$FIXTURE_ROOT/empty.bats"
[[ $status -eq 0 ]]
[[ $output = "1..0" ]]
}

0
test/fixtures/empty.bats vendored Normal file
View File