From c69d9a1128283f20ad883178e3649d7ed92be663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 13 Oct 2014 12:39:47 +0200 Subject: [PATCH] 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 --- test/which.bats | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/which.bats b/test/which.bats index 6e68a0e6..3f68a31a 100644 --- a/test/which.bats +++ b/test/which.bats @@ -93,7 +93,7 @@ echo HELLO="\$(printf ":%s" "\${hellos[@]}")" exit 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_output "HELLO=:hello:ugly:world:again" } @@ -103,6 +103,9 @@ SH cat > "${RBENV_ROOT}/version" <<<"1.8" create_executable "1.8" "ruby" + mkdir -p "$RBENV_TEST_DIR" + cd "$RBENV_TEST_DIR" + RBENV_VERSION= run rbenv-which ruby assert_success "${RBENV_ROOT}/versions/1.8/bin/ruby" }