mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Merge pull request #1203 from jf/fix_misleading_set_by_message_for_system_ruby
libexec/rbenv-version: get rid of misleading "set by $(rbenv-version-origin)" message when system ruby is in use
This commit is contained in:
commit
7795476af1
3 changed files with 12 additions and 5 deletions
|
@ -8,4 +8,11 @@
|
|||
set -e
|
||||
[ -n "$RBENV_DEBUG" ] && set -x
|
||||
|
||||
echo "$(rbenv-version-name) (set by $(rbenv-version-origin))"
|
||||
version_name="$(rbenv-version-name)"
|
||||
version_origin="$(rbenv-version-origin)"
|
||||
|
||||
if [ "$version_origin" = "${RBENV_ROOT}/version" ] && [ ! -e "$version_origin" ]; then
|
||||
echo "$version_name"
|
||||
else
|
||||
echo "$version_name (set by $version_origin)"
|
||||
fi
|
||||
|
|
|
@ -14,7 +14,7 @@ setup() {
|
|||
@test "no version selected" {
|
||||
assert [ ! -d "${RBENV_ROOT}/versions" ]
|
||||
run rbenv-version
|
||||
assert_success "system (set by ${RBENV_ROOT}/version)"
|
||||
assert_success "system"
|
||||
}
|
||||
|
||||
@test "set by RBENV_VERSION" {
|
||||
|
|
|
@ -21,7 +21,7 @@ stub_system_ruby() {
|
|||
stub_system_ruby
|
||||
assert [ ! -d "${RBENV_ROOT}/versions" ]
|
||||
run rbenv-versions
|
||||
assert_success "* system (set by ${RBENV_ROOT}/version)"
|
||||
assert_success "* system"
|
||||
}
|
||||
|
||||
@test "not even system ruby available" {
|
||||
|
@ -42,7 +42,7 @@ stub_system_ruby() {
|
|||
run rbenv-versions
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
* system (set by ${RBENV_ROOT}/version)
|
||||
* system
|
||||
1.9
|
||||
OUT
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ OUT
|
|||
run rbenv-versions
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
* system (set by ${RBENV_ROOT}/version)
|
||||
* system
|
||||
1.8.7
|
||||
1.9.3
|
||||
2.0.0
|
||||
|
|
Loading…
Reference in a new issue