mirror of
https://github.com/sstephenson/bats.git
synced 2024-11-17 03:32:27 +01:00
Test failing and passing in the same file
This commit is contained in:
parent
ac64e0b18a
commit
2e52aeff5d
|
@ -21,15 +21,23 @@ FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures"
|
|||
}
|
||||
|
||||
@test "one passing test" {
|
||||
run bats "$FIXTURE_ROOT/one_passing.bats"
|
||||
run bats "$FIXTURE_ROOT/passing.bats"
|
||||
[ $status -eq 0 ]
|
||||
[ ${lines[0]} = "1..1" ]
|
||||
[ ${lines[1]} = "ok 1 a passing test" ]
|
||||
}
|
||||
|
||||
@test "one failing test" {
|
||||
run bats "$FIXTURE_ROOT/one_failing.bats"
|
||||
run bats "$FIXTURE_ROOT/failing.bats"
|
||||
[ $status -eq 1 ]
|
||||
[ ${lines[0]} = "1..1" ]
|
||||
[ ${lines[1]} = "not ok 1 a failing test" ]
|
||||
}
|
||||
|
||||
@test "one failing and one passing test" {
|
||||
run bats "$FIXTURE_ROOT/failing_and_passing.bats"
|
||||
[ $status -eq 1 ]
|
||||
[ ${lines[0]} = "1..2" ]
|
||||
[ ${lines[1]} = "not ok 1 a failing test" ]
|
||||
[ ${lines[2]} = "ok 2 a passing test" ]
|
||||
}
|
||||
|
|
7
test/fixtures/failing_and_passing.bats
vendored
Normal file
7
test/fixtures/failing_and_passing.bats
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
@test "a failing test" {
|
||||
false
|
||||
}
|
||||
|
||||
@test "a passing test" {
|
||||
true
|
||||
}
|
Loading…
Reference in New Issue
Block a user