From a456528be82cc76e9a851b781426ad3fffe40b90 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 2 Aug 2016 00:21:28 +0000 Subject: [PATCH] Keep original ordering of PATH configuration --- test/prefix.bats | 9 +++++---- test/test_helper.bash | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/prefix.bats b/test/prefix.bats index b78b8f9..0376954 100644 --- a/test/prefix.bats +++ b/test/prefix.bats @@ -25,12 +25,13 @@ load test_helper } @test "prefix for system in /" { - mkdir -p "${RBENV_TEST_DIR}/bin" - touch "${RBENV_TEST_DIR}/bin/rbenv-which" - echo "echo /bin/ruby" >"${RBENV_TEST_DIR}/bin/rbenv-which" - chmod +x "${RBENV_TEST_DIR}/bin/rbenv-which" + mkdir -p "${BATS_TEST_DIRNAME}/libexec" + touch "${BATS_TEST_DIRNAME}/libexec/rbenv-which" + echo "echo /bin/ruby" >"${BATS_TEST_DIRNAME}/libexec/rbenv-which" + chmod +x "${BATS_TEST_DIRNAME}/libexec/rbenv-which" RBENV_VERSION="system" run rbenv-prefix assert_success "/" + rm -f "${BATS_TEST_DIRNAME}/libexec/rbenv-which" } @test "prefix for invalid system" { diff --git a/test/test_helper.bash b/test/test_helper.bash index a6cbb74..aef883a 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -20,10 +20,10 @@ if [ -z "$RBENV_TEST_DIR" ]; then export RBENV_HOOK_PATH="${RBENV_ROOT}/rbenv.d" PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin + PATH="${RBENV_TEST_DIR}/bin:$PATH" PATH="${BATS_TEST_DIRNAME}/../libexec:$PATH" PATH="${BATS_TEST_DIRNAME}/libexec:$PATH" PATH="${RBENV_ROOT}/shims:$PATH" - PATH="${RBENV_TEST_DIR}/bin:$PATH" export PATH for xdg_var in `env 2>/dev/null | grep ^XDG_ | cut -d= -f1`; do unset "$xdg_var"; done