mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Fix hooks tests on OS X by expanding BATS_TMPDIR
With `realpath` extension, hooks tests on OS X will output `/private/tmp` instead of `/tmp` because the latter is an actual symlink to the former. Avoid this mistmach in output assertions by expanding BATS_TMPDIR if `realpath` extension is compiled.
This commit is contained in:
parent
16c7eb4135
commit
284588f9b4
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,11 @@
|
|||
unset RBENV_VERSION
|
||||
unset RBENV_DIR
|
||||
|
||||
RBENV_TEST_DIR="${BATS_TMPDIR}/rbenv"
|
||||
if enable -f "${BATS_TEST_DIRNAME}"/../libexec/rbenv-realpath.dylib realpath 2>/dev/null; then
|
||||
RBENV_TEST_DIR="$(realpath "$BATS_TMPDIR")/rbenv"
|
||||
else
|
||||
RBENV_TEST_DIR="${BATS_TMPDIR}/rbenv"
|
||||
fi
|
||||
|
||||
# guard against executing this block twice due to bats internals
|
||||
if [ "$RBENV_ROOT" != "${RBENV_TEST_DIR}/root" ]; then
|
||||
|
|
Loading…
Reference in a new issue