Skip to content

Commit

Permalink
chore: keep $ORIGINAL_TERM after using dumb for acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Jul 23, 2024
1 parent c93b387 commit 36cd586
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 9 deletions.
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_direct_fn_call_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_MULTILINE_STR="first line
\n
four line
find me with \n a regular expression"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_direct_fn_call_passes() {
local expected="foo"
local actual="foo"
Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_fail_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_ENV_FILE_SIMPLE="tests/acceptance/fixtures/.env.simple"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_when_a_test_fail_verbose_output_env() {
local test_file=./tests/acceptance/fixtures/test_bashunit_when_a_test_fail.sh

Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_find_tests_command_line_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_all_tests_files_within_a_directory() {
local path="./tests/acceptance/fixtures"

Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_log_junit_test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/bin/bash

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_ENV_FILE_LOG_JUNIT="tests/acceptance/fixtures/.env.log_junit"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_when_log_junit_option() {
local test_file=./tests/acceptance/fixtures/test_bashunit_when_log_junit.sh

Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_pass_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_ENV_FILE_SIMPLE="tests/acceptance/fixtures/.env.simple"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_when_a_test_passes_verbose_output_env() {
local test_file=./tests/acceptance/fixtures/test_bashunit_when_a_test_passes.sh

Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_path_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_ENV_FILE_WITH_PATH="tests/acceptance/fixtures/.env.with_path"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_without_path_env_nor_argument() {
assert_match_snapshot "$(./bashunit --env "$TEST_ENV_FILE")"
assert_general_error "$(./bashunit --env "$TEST_ENV_FILE")"
Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_report_html_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_ENV_FILE_REPORT_HTML="tests/acceptance/fixtures/.env.report_html"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_when_report_html_option() {
local test_file=./tests/acceptance/fixtures/test_bashunit_when_report_html.sh

Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_stop_on_failure_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
TEST_ENV_FILE_STOP_ON_FAILURE="tests/acceptance/fixtures/.env.stop_on_failure"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_when_stop_on_failure_option() {
local test_file=./tests/acceptance/fixtures/test_bashunit_when_stop_on_failure.sh

Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/bashunit_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
set -euo pipefail

function set_up_before_script() {
TERM=dumb
ORIGINAL_TERM=$TERM
TEST_ENV_FILE="tests/acceptance/fixtures/.env.default"
}

function set_up() {
TERM=dumb
}

function tear_down() {
TERM=$ORIGINAL_TERM
}

function test_bashunit_should_display_version() {
local fixture
fixture=$(printf "bashunit - %s" "$BASHUNIT_VERSION")
Expand Down

0 comments on commit 36cd586

Please sign in to comment.