mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-17 07:43:46 -05:00
Separate startup logic into PATH and the rest
PATH manipulation should be done in ~/.profile rather than ~/.*rc since .rc can be sourced multiple times
This commit is contained in:
@@ -64,28 +64,28 @@ OUT
|
||||
|
||||
@test "adds shims to PATH" {
|
||||
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
|
||||
run pyenv-init - bash
|
||||
run pyenv-init --path bash
|
||||
assert_success
|
||||
assert_line 0 'export PATH="'${PYENV_ROOT}'/shims:${PATH}"'
|
||||
}
|
||||
|
||||
@test "adds shims to PATH (fish)" {
|
||||
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
|
||||
run pyenv-init - fish
|
||||
run pyenv-init --path fish
|
||||
assert_success
|
||||
assert_line 0 "set -gx PATH '${PYENV_ROOT}/shims' \$PATH"
|
||||
}
|
||||
|
||||
@test "can add shims to PATH more than once" {
|
||||
export PATH="${PYENV_ROOT}/shims:$PATH"
|
||||
run pyenv-init - bash
|
||||
run pyenv-init --path bash
|
||||
assert_success
|
||||
assert_line 0 'export PATH="'${PYENV_ROOT}'/shims:${PATH}"'
|
||||
}
|
||||
|
||||
@test "can add shims to PATH more than once (fish)" {
|
||||
export PATH="${PYENV_ROOT}/shims:$PATH"
|
||||
run pyenv-init - fish
|
||||
run pyenv-init --path fish
|
||||
assert_success
|
||||
assert_line 0 "set -gx PATH '${PYENV_ROOT}/shims' \$PATH"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user