mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Test IFS handling in version-name/version-origin hooks
This commit is contained in:
parent
0f7a2cad8d
commit
565798d617
2 changed files with 24 additions and 0 deletions
|
@ -31,6 +31,18 @@ setup() {
|
|||
assert_success "1.9.3"
|
||||
}
|
||||
|
||||
@test "carries original IFS within hooks" {
|
||||
create_hook version-name hello.bash <<SH
|
||||
hellos=(\$(printf "hello\\tugly world\\nagain"))
|
||||
echo HELLO="\$(printf ":%s" "\${hellos[@]}")"
|
||||
SH
|
||||
|
||||
export RBENV_VERSION=system
|
||||
IFS=$' \t\n' run rbenv-version-name env
|
||||
assert_success
|
||||
assert_line "HELLO=:hello:ugly:world:again"
|
||||
}
|
||||
|
||||
@test "RBENV_VERSION has precedence over local" {
|
||||
create_version "1.8.7"
|
||||
create_version "1.9.3"
|
||||
|
|
|
@ -38,6 +38,18 @@ setup() {
|
|||
assert_success "plugin"
|
||||
}
|
||||
|
||||
@test "carries original IFS within hooks" {
|
||||
create_hook version-origin hello.bash <<SH
|
||||
hellos=(\$(printf "hello\\tugly world\\nagain"))
|
||||
echo HELLO="\$(printf ":%s" "\${hellos[@]}")"
|
||||
SH
|
||||
|
||||
export RBENV_VERSION=system
|
||||
IFS=$' \t\n' run rbenv-version-origin env
|
||||
assert_success
|
||||
assert_line "HELLO=:hello:ugly:world:again"
|
||||
}
|
||||
|
||||
@test "doesn't inherit RBENV_VERSION_ORIGIN from environment" {
|
||||
RBENV_VERSION_ORIGIN=ignored run rbenv-version-origin
|
||||
assert_success "${RBENV_ROOT}/version"
|
||||
|
|
Loading…
Reference in a new issue