diff --git a/src/runner.sh b/src/runner.sh index 0290cf86..27fe6ff3 100755 --- a/src/runner.sh +++ b/src/runner.sh @@ -109,11 +109,11 @@ function runner::call_test_functions() { function runner::render_running_file_header() { if ! env::is_simple_output_enabled && ! parallel::is_enabled; then - printf "${_COLOR_BOLD}%s${_COLOR_DEFAULT}\n" "Running: $script" + printf "${_COLOR_BOLD}%s${_COLOR_DEFAULT}\n" "Running $script" fi if env::is_simple_output_enabled && env::is_verbose_enabled; then - printf "\n${_COLOR_BOLD}%s${_COLOR_DEFAULT}" "Running: $script" + printf "\n${_COLOR_BOLD}%s${_COLOR_DEFAULT}" "Running $script" fi } diff --git a/tests/acceptance/bashunit_execution_error_test.sh b/tests/acceptance/bashunit_execution_error_test.sh index 3f95c002..6bd2df34 100644 --- a/tests/acceptance/bashunit_execution_error_test.sh +++ b/tests/acceptance/bashunit_execution_error_test.sh @@ -36,7 +36,7 @@ function test_bashunit_when_a_execution_error() { } fixture_start=$( - printf "Running ./tests/acceptance/fixtures/test_bashunit_when_a_execution_error.sh" + printf "${color_bold}%s${color_default}\n" "Running ./tests/acceptance/fixtures/test_bashunit_when_a_execution_error.sh" format_fail_title "✗ Failed" ": Error" format_expect_title "Expected" format_expect_value "'127'" @@ -53,7 +53,9 @@ function test_bashunit_when_a_execution_error() { todo "Add snapshots with regex to assert this test (part of the error message is localized)" todo "Add snapshots with simple/verbose modes as in bashunit_pass_test and bashunit_fail_test" - assert_contains "$fixture_start" "$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file")" - assert_contains "$fixture_end" "$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file")" + # shellcheck disable=SC2155 + local actual="$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file")" + assert_contains "$fixture_start" "$actual" + assert_contains "$fixture_end" "$actual" assert_general_error "$(./bashunit --no-parallel --env "$TEST_ENV_FILE" "$test_file")" } diff --git a/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_env.snapshot b/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_env.snapshot index 9ab0f74a..3b2767ac 100644 --- a/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_env.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh ✓ Passed: Assert same ✓ Passed: Assert contains ✗ Failed: Assert failing diff --git a/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_option.snapshot b/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_option.snapshot index 9ab0f74a..3b2767ac 100644 --- a/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_fail_test_sh.test_bashunit_when_a_test_fail_verbose_output_option.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh ✓ Passed: Assert same ✓ Passed: Assert contains ✗ Failed: Assert failing diff --git a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot index fca9f648..e0c51a9a 100644 --- a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot +++ b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_with_wildcard.snapshot @@ -1,7 +1,7 @@ -Running ./tests/acceptance/fixtures/tests_path/a_test.sh +Running ./tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty -Running ./tests/acceptance/fixtures/tests_path/other_test.sh +Running ./tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot index fca9f648..e0c51a9a 100644 --- a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot +++ b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_directory.snapshot @@ -1,7 +1,7 @@ -Running ./tests/acceptance/fixtures/tests_path/a_test.sh +Running ./tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty -Running ./tests/acceptance/fixtures/tests_path/other_test.sh +Running ./tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_file.snapshot b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_file.snapshot index d814a6f1..c5d3131b 100644 --- a/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_file.snapshot +++ b/tests/acceptance/snapshots/bashunit_find_tests_command_line_test_sh.test_all_tests_files_within_a_file.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/tests_path/a_test.sh +Running ./tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty diff --git a/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_env.snapshot b/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_env.snapshot index 96a5c307..c5a8817d 100644 --- a/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_env.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh ✓ Passed: Success ✗ Failed: Failure Expected '2' diff --git a/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_option.snapshot b/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_option.snapshot index 96a5c307..c5a8817d 100644 --- a/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_log_junit_test_sh.test_bashunit_when_log_junit_option.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh ✓ Passed: Success ✗ Failed: Failure Expected '2' diff --git a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_env.snapshot b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_env.snapshot index 95c16c53..f92af98a 100644 --- a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_env.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh ✓ Passed: Assert same ✓ Passed: Assert contains ✓ Passed: Assert greater and less than diff --git a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_option.snapshot b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_option.snapshot index 95c16c53..f92af98a 100644 --- a/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_pass_test_sh.test_bashunit_when_a_test_passes_verbose_output_option.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh ✓ Passed: Assert same ✓ Passed: Assert contains ✓ Passed: Assert greater and less than diff --git a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot index bb7e0000..1a618d8c 100644 --- a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot +++ b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_argument_path.snapshot @@ -1,7 +1,7 @@ -Running tests/acceptance/fixtures/tests_path/a_test.sh +Running tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty -Running tests/acceptance/fixtures/tests_path/other_test.sh +Running tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot index bb7e0000..1a618d8c 100644 --- a/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot +++ b/tests/acceptance/snapshots/bashunit_path_test_sh.test_bashunit_with_env_default_path.snapshot @@ -1,7 +1,7 @@ -Running tests/acceptance/fixtures/tests_path/a_test.sh +Running tests/acceptance/fixtures/tests_path/a_test.sh ✓ Passed: Assert greater and less than ✓ Passed: Assert empty -Running tests/acceptance/fixtures/tests_path/other_test.sh +Running tests/acceptance/fixtures/tests_path/other_test.sh ✓ Passed: Assert same ✓ Passed: Assert contains diff --git a/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_env.snapshot b/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_env.snapshot index fb24266c..deab502d 100644 --- a/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_env.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_report_html.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_report_html.sh ✓ Passed: Success ✗ Failed: Fail Expected 'to be empty' diff --git a/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_option.snapshot b/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_option.snapshot index fb24266c..deab502d 100644 --- a/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_report_html_test_sh.test_bashunit_when_report_html_option.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_report_html.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_report_html.sh ✓ Passed: Success ✗ Failed: Fail Expected 'to be empty' diff --git a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot index 4d22f06a..250bb252 100644 --- a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot +++ b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_env.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh ✓ Passed: A success ✗ Failed: B error Expected '1' diff --git a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot index 4d22f06a..250bb252 100644 --- a/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot +++ b/tests/acceptance/snapshots/bashunit_stop_on_failure_test_sh.test_bashunit_when_stop_on_failure_option.snapshot @@ -1,4 +1,4 @@ -Running ./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh +Running ./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh ✓ Passed: A success ✗ Failed: B error Expected '1'