diff --git a/src/env.sh b/src/env.sh index 3790e1be..e4989916 100644 --- a/src/env.sh +++ b/src/env.sh @@ -26,7 +26,6 @@ _DEFAULT_HEADER_ASCII_ART="false" _DEFAULT_SIMPLE_OUTPUT="false" _DEFAULT_STOP_ON_FAILURE="false" _DEFAULT_SHOW_EXECUTION_TIME="true" -_DEFAULT_DEV_MODE="false" _DEFAULT_VERBOSE="false" : "${BASHUNIT_PARALLEL_RUN:=${PARALLEL_RUN:=$_DEFAULT_PARALLEL_RUN}}" @@ -35,7 +34,6 @@ _DEFAULT_VERBOSE="false" : "${BASHUNIT_SIMPLE_OUTPUT:=${SIMPLE_OUTPUT:=$_DEFAULT_SIMPLE_OUTPUT}}" : "${BASHUNIT_STOP_ON_FAILURE:=${STOP_ON_FAILURE:=$_DEFAULT_STOP_ON_FAILURE}}" : "${BASHUNIT_SHOW_EXECUTION_TIME:=${SHOW_EXECUTION_TIME:=$_DEFAULT_SHOW_EXECUTION_TIME}}" -: "${BASHUNIT_DEV_MODE:=${DEV_MODE:=$_DEFAULT_DEV_MODE}}" : "${BASHUNIT_VERBOSE:=${VERBOSE:=$_DEFAULT_VERBOSE}}" function env::is_parallel_run_enabled() { @@ -63,7 +61,7 @@ function env::is_show_execution_time_enabled() { } function env::is_dev_mode_enabled() { - [[ "$BASHUNIT_DEV_MODE" == "true" ]] + [[ -f "$BASHUNIT_DEV_LOG" ]] } function env::is_verbose_enabled() { diff --git a/tests/unit/globals_test.sh b/tests/unit/globals_test.sh index e8d4aa28..574188a2 100644 --- a/tests/unit/globals_test.sh +++ b/tests/unit/globals_test.sh @@ -1,6 +1,10 @@ #!/bin/bash set -euo pipefail +function tear_down_after_script() { + export BASHUNIT_DEV_LOG="" +} + function set_up() { BASHUNIT_DEV_LOG=$(temp_file) export BASHUNIT_DEV_LOG @@ -10,14 +14,6 @@ function tear_down() { rm "$BASHUNIT_DEV_LOG" } -function set_up_before_script() { - export BASHUNIT_DEV_MODE=true -} - -function tear_down_after_script() { - export BASHUNIT_DEV_MODE=$_DEFAULT_DEV_MODE -} - function test_globals_current_dir() { assert_same "tests/unit" "$(current_dir)" }