Add test for not including current directory in PATH search

Confirms #836
This commit is contained in:
Mislav Marohnić 2015-12-14 11:59:01 +01:00
parent dc23ef10b6
commit 90373d78b9

View file

@ -56,6 +56,16 @@ create_executable() {
assert_success "${RBENV_TEST_DIR}/bin/kill-all-humans"
}
@test "doesn't include current directory in PATH search" {
export PATH="$(path_without "kill-all-humans")"
mkdir -p "$RBENV_TEST_DIR"
cd "$RBENV_TEST_DIR"
touch kill-all-humans
chmod +x kill-all-humans
RBENV_VERSION=system run rbenv-which kill-all-humans
assert_failure "rbenv: kill-all-humans: command not found"
}
@test "version not installed" {
create_executable "2.0" "rspec"
RBENV_VERSION=1.9 run rbenv-which rspec