mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-19 09:03:47 -05:00
Test IFS handling in version-name/version-origin hooks
This commit is contained in:
@@ -31,6 +31,18 @@ setup() {
|
|||||||
assert_success "1.9.3"
|
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" {
|
@test "RBENV_VERSION has precedence over local" {
|
||||||
create_version "1.8.7"
|
create_version "1.8.7"
|
||||||
create_version "1.9.3"
|
create_version "1.9.3"
|
||||||
|
|||||||
@@ -38,6 +38,18 @@ setup() {
|
|||||||
assert_success "plugin"
|
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" {
|
@test "doesn't inherit RBENV_VERSION_ORIGIN from environment" {
|
||||||
RBENV_VERSION_ORIGIN=ignored run rbenv-version-origin
|
RBENV_VERSION_ORIGIN=ignored run rbenv-version-origin
|
||||||
assert_success "${RBENV_ROOT}/version"
|
assert_success "${RBENV_ROOT}/version"
|
||||||
|
|||||||
Reference in New Issue
Block a user