mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
parent
6ca591ab75
commit
060f141b21
3 changed files with 42 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -52,3 +52,17 @@ rspec
|
|||
ruby
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "carries original IFS within hooks" {
|
||||
hook_path="${RBENV_TEST_DIR}/rbenv.d"
|
||||
mkdir -p "${hook_path}/rehash"
|
||||
cat > "${hook_path}/rehash/hello.bash" <<SH
|
||||
hellos=(\$(printf "hello\\tugly world\\nagain"))
|
||||
echo HELLO="\$(printf ":%s" "\${hellos[@]}")"
|
||||
exit
|
||||
SH
|
||||
|
||||
RBENV_HOOK_PATH="$hook_path" IFS=$' \t\n' run rbenv-rehash
|
||||
assert_success
|
||||
assert_output "HELLO=:hello:ugly:world:again"
|
||||
}
|
||||
|
|
|
@ -58,3 +58,17 @@ The \`rspec' command exists in these Ruby versions:
|
|||
2.0
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "carries original IFS within hooks" {
|
||||
hook_path="${RBENV_TEST_DIR}/rbenv.d"
|
||||
mkdir -p "${hook_path}/which"
|
||||
cat > "${hook_path}/which/hello.bash" <<SH
|
||||
hellos=(\$(printf "hello\\tugly world\\nagain"))
|
||||
echo HELLO="\$(printf ":%s" "\${hellos[@]}")"
|
||||
exit
|
||||
SH
|
||||
|
||||
RBENV_HOOK_PATH="$hook_path" IFS=$' \t\n' run rbenv-which anything
|
||||
assert_success
|
||||
assert_output "HELLO=:hello:ugly:world:again"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue