1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-12-27 06:59:45 +01:00

bats_test_info -> bats_test_begin; begin calls setup

This commit is contained in:
Sam Stephenson 2013-10-21 11:21:17 -05:00
parent a773171777
commit 7849374964
2 changed files with 4 additions and 5 deletions

View File

@ -63,8 +63,9 @@ skip() {
exit 0 exit 0
} }
bats_test_info() { bats_test_begin() {
BATS_TEST_DESCRIPTION="$1" BATS_TEST_DESCRIPTION="$1"
setup
} }
bats_test_function() { bats_test_function() {
@ -141,9 +142,7 @@ bats_perform_test() {
trap "bats_debug_trap \"\$BASH_SOURCE\" \$LINENO" debug trap "bats_debug_trap \"\$BASH_SOURCE\" \$LINENO" debug
trap "bats_error_trap" err trap "bats_error_trap" err
trap "bats_teardown_trap" exit trap "bats_teardown_trap" exit
{ setup "$BATS_TEST_NAME" >>"$BATS_OUT" 2>&1
"$BATS_TEST_NAME"
} >>"$BATS_OUT" 2>&1
BATS_TEST_COMPLETED=1 BATS_TEST_COMPLETED=1
else else

View File

@ -40,7 +40,7 @@ while IFS= read -r line; do
name="$(eval echo "$quoted_name")" name="$(eval echo "$quoted_name")"
encoded_name="$(encode_name "$name")" encoded_name="$(encode_name "$name")"
tests["${#tests[@]}"]="$encoded_name" tests["${#tests[@]}"]="$encoded_name"
echo "${encoded_name}() { bats_test_info ${quoted_name} ${index}" echo "${encoded_name}() { bats_test_begin ${quoted_name} ${index}"
else else
printf "%s\n" "$line" printf "%s\n" "$line"
fi fi