From c8c56a987c80292cdb02d67c5d8c489f2cb14816 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Mon, 21 Oct 2013 10:57:53 -0500 Subject: [PATCH] More descriptive message for failing line and file --- libexec/bats-exec-test | 2 +- test/bats.bats | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/bats-exec-test b/libexec/bats-exec-test index 8f4396f..f897eb7 100755 --- a/libexec/bats-exec-test +++ b/libexec/bats-exec-test @@ -104,7 +104,7 @@ bats_exit_trap() { if [ -z "$BATS_TEST_COMPLETED" ]; then echo "not ok $BATS_TEST_NUMBER $BATS_TEST_DESCRIPTION" >&3 - echo "# $BATS_TEST_FILENAME:$BATS_LINE_NUMBER" >&3 + echo "# (in test file $BATS_TEST_FILENAME, line $BATS_LINE_NUMBER)" >&3 sed -e "s/^/# /" < "$BATS_OUT" >&3 status=1 else diff --git a/test/bats.bats b/test/bats.bats index 245fab1..b6ab93b 100755 --- a/test/bats.bats +++ b/test/bats.bats @@ -39,7 +39,7 @@ fixtures bats [ $status -eq 1 ] [ ${lines[0]} = "1..1" ] [ ${lines[1]} = "not ok 1 a failing test" ] - [ ${lines[2]} = "# $FIXTURE_ROOT/failing.bats:4" ] + [ ${lines[2]} = "# (in test file $FIXTURE_ROOT/failing.bats, line 4)" ] } @test "one failing and one passing test" { @@ -47,7 +47,7 @@ fixtures bats [ $status -eq 1 ] [ ${lines[0]} = "1..2" ] [ ${lines[1]} = "not ok 1 a failing test" ] - [ ${lines[2]} = "# $FIXTURE_ROOT/failing_and_passing.bats:2" ] + [ ${lines[2]} = "# (in test file $FIXTURE_ROOT/failing_and_passing.bats, line 2)" ] [ ${lines[3]} = "ok 2 a passing test" ] }