Unverified Commit 7de903c5 authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

Fix `rbenv install --list` exit status

parent a4ac4be4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ for option in "${OPTIONS[@]}"; do
    ;;
  "l" | "list" )
    ruby-build --list
    [ -t 1 ] && {
    [ ! -t 1 ] || {
      echo
      echo "Only latest stable releases for each Ruby implementation are shown."
      echo "Use 'rbenv install --list-all / -L' to show all local versions."
+9 −0
Original line number Diff line number Diff line
@@ -51,6 +51,15 @@ OUT
  unstub rbenv-local
}

@test "list latest versions" {
  stub_ruby_build "--list : echo 2.1.2"

  run rbenv-install --list
  assert_success "2.1.2"

  unstub ruby-build
}

@test "list available versions" {
  stub_ruby_build \
    "--definitions : echo 1.8.7 1.9.3-p0 1.9.3-p194 2.1.2 | tr ' ' $'\\n'"