From 974dbf6a7c1a2095e109cba9f87524521e267799 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 28 Dec 2011 18:25:05 -0600 Subject: [PATCH] [[ isn't a simple command and thus isn't subject to `set -e` --- test/bats.bats | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/bats.bats b/test/bats.bats index c168279..1026158 100755 --- a/test/bats.bats +++ b/test/bats.bats @@ -4,25 +4,25 @@ FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures" @test "no arguments prints usage instructions" { run bats - [[ $status -eq 1 ]] - [[ $output =~ ^usage: ]] + [ $status -eq 1 ] + [ $(expr "$output" : "usage:") -ne 0 ] } @test "invalid filename prints an error" { run bats nonexistent - [[ $status -eq 1 ]] - [[ $output =~ does\ not\ exist ]] + [ $status -eq 1 ] + [ $(expr "$output" : ".*does not exist") -ne 0 ] } @test "empty test file runs zero tests" { run bats "$FIXTURE_ROOT/empty.bats" - [[ $status -eq 0 ]] - [[ $output = "1..0" ]] + [ $status -eq 0 ] + [ $output = "1..0" ] } @test "one passing test" { run bats "$FIXTURE_ROOT/one_passing.bats" - [[ $status -eq 0 ]] - [[ ${lines[0]} = "1..1" ]] - [[ ${lines[1]} = "ok 1 a passing test" ]] + [ $status -eq 0 ] + [ ${lines[0]} = "1..1" ] + [ ${lines[1]} = "ok 1 a passing test" ] }