From 784937496459f709808df388ccdec14c317e7188 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Mon, 21 Oct 2013 11:21:17 -0500 Subject: [PATCH] bats_test_info -> bats_test_begin; begin calls setup --- libexec/bats-exec-test | 7 +++---- libexec/bats-preprocess | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libexec/bats-exec-test b/libexec/bats-exec-test index d77c234..f047892 100755 --- a/libexec/bats-exec-test +++ b/libexec/bats-exec-test @@ -63,8 +63,9 @@ skip() { exit 0 } -bats_test_info() { +bats_test_begin() { BATS_TEST_DESCRIPTION="$1" + setup } bats_test_function() { @@ -141,9 +142,7 @@ bats_perform_test() { trap "bats_debug_trap \"\$BASH_SOURCE\" \$LINENO" debug trap "bats_error_trap" err trap "bats_teardown_trap" exit - { setup - "$BATS_TEST_NAME" - } >>"$BATS_OUT" 2>&1 + "$BATS_TEST_NAME" >>"$BATS_OUT" 2>&1 BATS_TEST_COMPLETED=1 else diff --git a/libexec/bats-preprocess b/libexec/bats-preprocess index 1592ebd..26730e0 100755 --- a/libexec/bats-preprocess +++ b/libexec/bats-preprocess @@ -40,7 +40,7 @@ while IFS= read -r line; do name="$(eval echo "$quoted_name")" encoded_name="$(encode_name "$name")" tests["${#tests[@]}"]="$encoded_name" - echo "${encoded_name}() { bats_test_info ${quoted_name} ${index}" + echo "${encoded_name}() { bats_test_begin ${quoted_name} ${index}" else printf "%s\n" "$line" fi