mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 15:23:53 -05:00
Use create_hook helper
Use extracted create_hook helper in tests for: - exec - hooks - rehash - version-name - version-origin - which
This commit is contained in:
@@ -44,15 +44,13 @@ OUT
|
||||
}
|
||||
|
||||
@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
|
||||
create_hook 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
|
||||
IFS=$' \t\n' run rbenv-exec env
|
||||
assert_success
|
||||
assert_line "HELLO=:hello:ugly:world:again"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user