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:
@@ -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
7
test/fixtures/bats/skipped.bats
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@test "a skipped test" {
|
||||
skip
|
||||
}
|
||||
|
||||
@test "a skipped test with a reason" {
|
||||
skip "a reason"
|
||||
}
|
||||
Reference in New Issue
Block a user