Skip to content

Commit

Permalink
feat: remove unnecesary $BASHUNIT_DEV_MODE, use $BASHUNIT_DEV_LOG ins…
Browse files Browse the repository at this point in the history
…tead
  • Loading branch information
Chemaclass committed Oct 16, 2024
1 parent e6594d4 commit 572ac1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand All @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
12 changes: 4 additions & 8 deletions tests/unit/globals_test.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)"
}
Expand Down

0 comments on commit 572ac1a

Please sign in to comment.