fix: Fix shell completions tests for pyenv-init
In `test_helper.bash`: set PATH="${BATS_TEST_DIRNAME%/*}/libexec:$PATH" instead of PATH="${BATS_TEST_DIRNAME}../libexec:$PATH" it essentially enables us to expect `${exec_root}/completions/pyenv.bash` instead of something like `${exec_root}/test/../completions/pyenv.zsh
This commit is contained in:
parent
2e1c756793
commit
b1882cb6fe
@ -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" {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user