1
0
mirror of https://github.com/sstephenson/bats.git synced 2026-02-25 09:18:10 +01:00

Merge pull request #19 from duggan/internal-skips

Support for TAP compliant skip directive inside test blocks.
This commit is contained in:
Sam Stephenson
2013-10-18 14:14:35 -07:00
4 changed files with 79 additions and 1 deletions

View File

@@ -110,3 +110,22 @@ fixtures bats
run bats "$FIXTURE_ROOT/dos_line.bats"
[ $status -eq 0 ]
}
@test "a skipped test" {
skip
run bats
[ $status -eq 0 ]
}
@test "a skipped test with a reason" {
skip "a reason for skipping"
run bats
[ $status -eq 0 ]
}
@test "skipped test output" {
run bats "$FIXTURE_ROOT/skipped.bats"
[ $status -eq 0 ]
[ "${lines[1]}" = "ok 1 # skip a skipped test" ]
[ "${lines[2]}" = "ok 2 # skip (a reason) a skipped test with a reason" ]
}

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

@@ -0,0 +1,7 @@
@test "a skipped test" {
skip
}
@test "a skipped test with a reason" {
skip "a reason"
}