From df154edc253a20bf1c7eef17e56cc46d9df1e3a4 Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Fri, 27 Jan 2023 04:09:43 -0800 Subject: [PATCH] test: better isolate Git in test suite (#1454) --- test/setup_suite.bash | 9 +++++++++ test/test_helpers.bash | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 test/setup_suite.bash diff --git a/test/setup_suite.bash b/test/setup_suite.bash new file mode 100644 index 00000000..549b195b --- /dev/null +++ b/test/setup_suite.bash @@ -0,0 +1,9 @@ +setup_suite() { + # Unset ASDF_DIR because it may already be set by the users shell, and some + # tests fail when it is set to something other than the temp dir. + unset ASDF_DIR + + # Set an agnostic Git configuration directory to prevent personal + # configuration from interfering with the tests + export GIT_CONFIG_GLOBAL=/dev/null +} diff --git a/test/test_helpers.bash b/test/test_helpers.bash index 1704fce7..354d087d 100644 --- a/test/test_helpers.bash +++ b/test/test_helpers.bash @@ -1,9 +1,5 @@ #!/usr/bin/env bash -# Unset ASDF_DIR because it may already be set by the users shell, and some -# tests fail when it is set to something other than the temp dir. -unset ASDF_DIR - # shellcheck source=lib/utils.bash . "$(dirname "$BATS_TEST_DIRNAME")"/lib/utils.bash