test: better isolate Git in test suite (#1454)

This commit is contained in:
Edwin Kofler 2023-01-27 04:09:43 -08:00 committed by GitHub
parent ffa018763c
commit df154edc25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

9
test/setup_suite.bash Normal file
View File

@ -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
}

View File

@ -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