Use mktemp -d for RBENV_TEST_DIR

This prevents the tests from removing an existing directory.

Fixes #561 (https://github.com/sstephenson/rbenv/issues/561)
This commit is contained in:
Daniel Hahler 2014-03-13 20:40:47 +01:00
parent 14bc162ca6
commit 024bee1a6f

View file

@ -1,7 +1,7 @@
unset RBENV_VERSION unset RBENV_VERSION
unset RBENV_DIR unset RBENV_DIR
RBENV_TEST_DIR="${BATS_TMPDIR}/rbenv" RBENV_TEST_DIR="$(mktemp -d --tmpdir=$BATS_TMPDIR rbenv.bats.XXX)"
# guard against executing this block twice due to bats internals # guard against executing this block twice due to bats internals
if [ "$RBENV_ROOT" != "${RBENV_TEST_DIR}/root" ]; then if [ "$RBENV_ROOT" != "${RBENV_TEST_DIR}/root" ]; then