diff --git a/test/init.bats b/test/init.bats index 16314d76..c0831d40 100755 --- a/test/init.bats +++ b/test/init.bats @@ -36,11 +36,10 @@ create_executable() { } @test "setup shell completions" { - root="$(cd $BATS_TEST_DIRNAME/.. && pwd)" - export PYENV_ROOT=$root + exec_root="$(cd $BATS_TEST_DIRNAME/.. && pwd)" run pyenv-init - bash assert_success - assert_line "source '${root}/completions/pyenv.bash'" + assert_line "source '${exec_root}/completions/pyenv.bash'" } @test "detect parent shell" { @@ -63,11 +62,10 @@ OUT } @test "setup shell completions (fish)" { - root="$(cd $BATS_TEST_DIRNAME/.. && pwd)" - export PYENV_ROOT=$root + exec_root="$(cd $BATS_TEST_DIRNAME/.. && pwd)" run pyenv-init - fish assert_success - assert_line "source '${root}/completions/pyenv.fish'" + assert_line "source '${exec_root}/completions/pyenv.fish'" } @test "fish instructions" { diff --git a/test/test_helper.bash b/test/test_helper.bash index 4e32df30..51dcd83d 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -21,7 +21,7 @@ if [ -z "$PYENV_TEST_DIR" ]; then PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin PATH="${PYENV_TEST_DIR}/bin:$PATH" - PATH="${BATS_TEST_DIRNAME}/../libexec:$PATH" + PATH="${BATS_TEST_DIRNAME%/*}/libexec:$PATH" PATH="${BATS_TEST_DIRNAME}/libexec:$PATH" PATH="${PYENV_ROOT}/shims:$PATH" export PATH