From 90373d78b91484b738d57f2bb54c6b417c95e182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 14 Dec 2015 11:59:01 +0100 Subject: [PATCH] Add test for not including current directory in PATH search Confirms #836 --- test/which.bats | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/which.bats b/test/which.bats index 25c80528..004852f1 100644 --- a/test/which.bats +++ b/test/which.bats @@ -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