Skip to content

Commit

Permalink
Also unset DATA_DIR and CONFIG_FILE during test
Browse files Browse the repository at this point in the history
Like ASDF_DIR, these two are also likely to be set by user's login
shell, especially the shimmed `bats` (which calls `asdf_cmd()`) command
will eventually set them to user's actual in-use ones, causing conflicts
with the temporary test setup.
  • Loading branch information
bootleq committed Oct 20, 2024
1 parent c5116dc commit a08dd7c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/setup_suite.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ setup_suite() {
# tests fail when it is set to something other than the temp dir.
unset ASDF_DIR

# Also unset below variables, because in users shell shimmed commands
# (include bats) export them by determining user's real HOME.
unset ASDF_DATA_DIR
unset ASDF_CONFIG_FILE

# Set an agnostic Git configuration directory to prevent personal
# configuration from interfering with the tests
export GIT_CONFIG_GLOBAL=/dev/null
Expand Down

0 comments on commit a08dd7c

Please sign in to comment.