Unset XDG_CONFIG_HOME and related variables during tests

If set by the user's environment, `git config --global` writes will go
to that destination instead of temporary $HOME. We definitely don't want
that.

Fixes #742
This commit is contained in:
Mislav Marohnić 2015-10-10 18:30:44 +02:00
parent c43928a8e4
commit 3a265c1af9

View file

@ -22,6 +22,9 @@ if [ "$RBENV_ROOT" != "${RBENV_TEST_DIR}/root" ]; then
PATH="${BATS_TEST_DIRNAME}/libexec:$PATH" PATH="${BATS_TEST_DIRNAME}/libexec:$PATH"
PATH="${RBENV_ROOT}/shims:$PATH" PATH="${RBENV_ROOT}/shims:$PATH"
export PATH export PATH
for xdg_var in `env 2>/dev/null | grep ^XDG_ | cut -d= -f1`; do unset "$xdg_var"; done
unset xdg_var
fi fi
teardown() { teardown() {