mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 23:33:45 -05:00
Import rbenv changes at 7e0e85bdda
This commit is contained in:
@@ -45,3 +45,31 @@ load test_helper
|
||||
assert_failure
|
||||
assert_output "pyenv: cannot change working directory to \`$dir'"
|
||||
}
|
||||
|
||||
@test "adds its own libexec to PATH" {
|
||||
run pyenv echo "PATH"
|
||||
assert_success "${BATS_TEST_DIRNAME%/*}/libexec:$PATH"
|
||||
}
|
||||
|
||||
@test "adds plugin bin dirs to PATH" {
|
||||
mkdir -p "$PYENV_ROOT"/plugins/python-build/bin
|
||||
mkdir -p "$PYENV_ROOT"/plugins/pyenv-each/bin
|
||||
run pyenv echo -F: "PATH"
|
||||
assert_success
|
||||
assert_line 0 "${BATS_TEST_DIRNAME%/*}/libexec"
|
||||
assert_line 1 "${PYENV_ROOT}/plugins/python-build/bin"
|
||||
assert_line 2 "${PYENV_ROOT}/plugins/pyenv-each/bin"
|
||||
}
|
||||
|
||||
@test "PYENV_HOOK_PATH preserves value from environment" {
|
||||
PYENV_HOOK_PATH=/my/hook/path:/other/hooks run pyenv echo -F: "PYENV_HOOK_PATH"
|
||||
assert_success
|
||||
assert_line 0 "/my/hook/path"
|
||||
assert_line 1 "/other/hooks"
|
||||
assert_line 2 "${PYENV_ROOT}/pyenv.d"
|
||||
}
|
||||
|
||||
@test "PYENV_HOOK_PATH includes pyenv built-in plugins" {
|
||||
run pyenv echo "PYENV_HOOK_PATH"
|
||||
assert_success ":${PYENV_ROOT}/pyenv.d:${BATS_TEST_DIRNAME%/*}/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user