1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 07:43:46 -05:00

test that IFS in hooks is correct

closes #379
This commit is contained in:
Mislav Marohnić
2013-04-16 14:01:04 +02:00
parent 6ca591ab75
commit 060f141b21
3 changed files with 42 additions and 0 deletions

View File

@@ -45,6 +45,20 @@ OUT
assert_line "HELLO=from hook"
}
@test "carries original IFS within hooks" {
hook_path="${RBENV_TEST_DIR}/rbenv.d"
mkdir -p "${hook_path}/exec"
cat > "${hook_path}/exec/hello.bash" <<SH
hellos=(\$(printf "hello\\tugly world\\nagain"))
echo HELLO="\$(printf ":%s" "\${hellos[@]}")"
SH
export RBENV_VERSION=system
RBENV_HOOK_PATH="$hook_path" IFS=$' \t\n' run rbenv-exec env
assert_success
assert_line "HELLO=:hello:ugly:world:again"
}
@test "forwards all arguments" {
export RBENV_VERSION="2.0"
create_executable "ruby" <<SH