From a9ca72ab8e5dc128db1c82e1d25a6e1dbf9b15d3 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 5 Jun 2017 15:27:58 +0200 Subject: [PATCH] test/which.bats: do not export PATH Otherwise `sed` might not be found later in bats/libexec/bats-exec-test, in case `/usr/bin` gets removed. --- test/which.bats | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/which.bats b/test/which.bats index d9759845..c4a0197a 100644 --- a/test/which.bats +++ b/test/which.bats @@ -57,12 +57,11 @@ create_executable() { } @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 + PATH="$(path_without "kill-all-humans")" RBENV_VERSION=system run rbenv-which kill-all-humans assert_failure "rbenv: kill-all-humans: command not found" } @@ -79,8 +78,7 @@ create_executable() { } @test "no executable found for system version" { - export PATH="$(path_without "rake")" - RBENV_VERSION=system run rbenv-which rake + PATH="$(path_without "rake")" RBENV_VERSION=system run rbenv-which rake assert_failure "rbenv: rake: command not found" }