mirror of
https://github.com/sstephenson/bats.git
synced 2026-02-25 09:18:10 +01:00
Pretty test output for terminals
This commit is contained in:
@@ -6,7 +6,7 @@ fixtures bats
|
||||
@test "no arguments prints usage instructions" {
|
||||
run bats
|
||||
[ $status -eq 1 ]
|
||||
[ $(expr "${lines[1]}" : "usage:") -ne 0 ]
|
||||
[ $(expr "${lines[1]}" : "Usage:") -ne 0 ]
|
||||
}
|
||||
|
||||
@test "-v and --version print version number" {
|
||||
@@ -15,6 +15,12 @@ fixtures bats
|
||||
[ $(expr "$output" : "Bats [0-9][0-9.]*") -ne 0 ]
|
||||
}
|
||||
|
||||
@test "-h and --help print help" {
|
||||
run bats -h
|
||||
[ $status -eq 0 ]
|
||||
[ "${#lines[@]}" -gt 3 ]
|
||||
}
|
||||
|
||||
@test "invalid filename prints an error" {
|
||||
run bats nonexistent
|
||||
[ $status -eq 1 ]
|
||||
@@ -126,3 +132,15 @@ fixtures bats
|
||||
[ "${lines[4]}" = "begin 2 a passing test" ]
|
||||
[ "${lines[5]}" = "ok 2 a passing test" ]
|
||||
}
|
||||
|
||||
@test "pretty and tap formats" {
|
||||
run bats --tap "$FIXTURE_ROOT/passing.bats"
|
||||
tap_output="$output"
|
||||
[ $status -eq 0 ]
|
||||
|
||||
run bats --pretty "$FIXTURE_ROOT/passing.bats"
|
||||
pretty_output="$output"
|
||||
[ $status -eq 0 ]
|
||||
|
||||
[ "$tap_output" != "$pretty_output" ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user