Isolate rbenv-which tests from any .ruby-version file on the system

Having a `.ruby-version` file in any of the parent directories of the
local clone of rbenv could cause the test suite to fail because it
wasn't expecting a local version to be set.

Fixes #533
This commit is contained in:
Mislav Marohnić 2014-10-13 12:39:47 +02:00
parent f4652fbbf0
commit c69d9a1128

View file

@ -93,7 +93,7 @@ echo HELLO="\$(printf ":%s" "\${hellos[@]}")"
exit exit
SH SH
RBENV_HOOK_PATH="$hook_path" IFS=$' \t\n' run rbenv-which anything RBENV_HOOK_PATH="$hook_path" IFS=$' \t\n' RBENV_VERSION=system run rbenv-which anything
assert_success assert_success
assert_output "HELLO=:hello:ugly:world:again" assert_output "HELLO=:hello:ugly:world:again"
} }
@ -103,6 +103,9 @@ SH
cat > "${RBENV_ROOT}/version" <<<"1.8" cat > "${RBENV_ROOT}/version" <<<"1.8"
create_executable "1.8" "ruby" create_executable "1.8" "ruby"
mkdir -p "$RBENV_TEST_DIR"
cd "$RBENV_TEST_DIR"
RBENV_VERSION= run rbenv-which ruby RBENV_VERSION= run rbenv-which ruby
assert_success "${RBENV_ROOT}/versions/1.8/bin/ruby" assert_success "${RBENV_ROOT}/versions/1.8/bin/ruby"
} }