Ensure RBENV_VERSION_ORIGIN is not inherited from environment

It's only supposed to be set from `version-origin` hooks, but not
inherited from environment in case it was set.
This commit is contained in:
Mislav Marohnić 2015-12-23 17:26:53 +01:00
parent 40c1d27445
commit 4fde4ecbaf
2 changed files with 7 additions and 0 deletions

View file

@ -3,6 +3,8 @@
set -e
[ -n "$RBENV_DEBUG" ] && set -x
unset RBENV_VERSION_ORIGIN
OLDIFS="$IFS"
IFS=$'\n' scripts=(`rbenv-hooks version-origin`)
IFS="$OLDIFS"

View file

@ -52,3 +52,8 @@ setup() {
assert_success "plugin"
}
@test "doesn't inherit RBENV_VERSION_ORIGIN from environment" {
RBENV_VERSION_ORIGIN=ignored run rbenv-version-origin
assert_success "${RBENV_ROOT}/version"
}