mirror of
https://github.com/sstephenson/bats.git
synced 2026-02-25 09:18:10 +01:00
Test failing and passing in the same file
This commit is contained in:
@@ -21,15 +21,23 @@ FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures"
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "one passing test" {
|
@test "one passing test" {
|
||||||
run bats "$FIXTURE_ROOT/one_passing.bats"
|
run bats "$FIXTURE_ROOT/passing.bats"
|
||||||
[ $status -eq 0 ]
|
[ $status -eq 0 ]
|
||||||
[ ${lines[0]} = "1..1" ]
|
[ ${lines[0]} = "1..1" ]
|
||||||
[ ${lines[1]} = "ok 1 a passing test" ]
|
[ ${lines[1]} = "ok 1 a passing test" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "one failing test" {
|
@test "one failing test" {
|
||||||
run bats "$FIXTURE_ROOT/one_failing.bats"
|
run bats "$FIXTURE_ROOT/failing.bats"
|
||||||
[ $status -eq 1 ]
|
[ $status -eq 1 ]
|
||||||
[ ${lines[0]} = "1..1" ]
|
[ ${lines[0]} = "1..1" ]
|
||||||
[ ${lines[1]} = "not ok 1 a failing test" ]
|
[ ${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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user