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

Skip pretty formatting if the first line isn't a TAP plan

Closes #21
This commit is contained in:
Sam Stephenson
2013-10-28 14:46:30 -05:00
parent d2c5b9ef71
commit 25505bd143
3 changed files with 28 additions and 6 deletions

View File

@@ -150,3 +150,10 @@ fixtures bats
[ "$tap_output" != "$pretty_output" ]
}
@test "pretty formatter bails on invalid tap" {
run bats --tap "$FIXTURE_ROOT/invalid_tap.bats"
[ $status -eq 1 ]
[ "${lines[0]}" = "This isn't TAP!" ]
[ "${lines[1]}" = "Good day to you" ]
}

7
test/fixtures/bats/invalid_tap.bats vendored Normal file
View File

@@ -0,0 +1,7 @@
echo "This isn't TAP!"
echo "Good day to you"
exit 1
@test "truth" {
true
}