瀏覽代碼

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
pull/360/head^2
Mislav Marohnić 10 年之前
父節點
當前提交
c69d9a1128
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      test/which.bats

+ 4
- 1
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"
}

Loading…
取消
儲存