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

Support for TAP compliant skip directive inside test blocks.

This commit is contained in:
Ross Duggan
2013-10-18 22:05:20 +01:00
parent bc72b85871
commit f78324dfec
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"
}