1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-18 08:13:46 -05:00

Test IFS handling in version-name/version-origin hooks

This commit is contained in:
Jason Karns
2015-12-29 11:15:27 -05:00
parent 0f7a2cad8d
commit 565798d617
2 changed files with 24 additions and 0 deletions

View File

@@ -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"