diff --git a/test/test_helper.bash b/test/test_helper.bash index 53ae8e64..1f772bea 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -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