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

Extended syntax: "begin" line before each test is run

This commit is contained in:
Sam Stephenson
2013-10-21 11:32:09 -05:00
parent 7849374964
commit 8873aab79f
4 changed files with 46 additions and 6 deletions

View File

@@ -129,3 +129,12 @@ fixtures bats
[ "${lines[1]}" = "ok 1 # skip a skipped test" ]
[ "${lines[2]}" = "ok 2 # skip (a reason) a skipped test with a reason" ]
}
@test "extended syntax" {
run bats-exec-test -x "$FIXTURE_ROOT/failing_and_passing.bats"
[ $status -eq 1 ]
[ "${lines[1]}" = "begin 1 a failing test" ]
[ "${lines[2]}" = "not ok 1 a failing test" ]
[ "${lines[4]}" = "begin 2 a passing test" ]
[ "${lines[5]}" = "ok 2 a passing test" ]
}

View File

@@ -50,3 +50,15 @@ fixtures suite
echo "$output" | grep "^ok . more truth"
echo "$output" | grep "^ok . quasi-truth"
}
@test "extended syntax in suite" {
FLUNK=1 run bats-exec-suite -x "$FIXTURE_ROOT/multiple/"*.bats
[ $status -eq 1 ]
[ "${lines[0]}" = "1..3" ]
[ "${lines[1]}" = "begin 1 truth" ]
[ "${lines[2]}" = "ok 1 truth" ]
[ "${lines[3]}" = "begin 2 more truth" ]
[ "${lines[4]}" = "ok 2 more truth" ]
[ "${lines[5]}" = "begin 3 quasi-truth" ]
[ "${lines[6]}" = "not ok 3 quasi-truth" ]
}