Skip to content

Commit

Permalink
Merge pull request #2432 from piperswe/fix-nonexistent-version
Browse files Browse the repository at this point in the history
Allow "nonexistent version" test to work without brew
  • Loading branch information
mislav authored Jan 21, 2025
2 parents 3366b3b + 434ce5f commit 3643c8e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/rbenv.bats
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,19 @@ OUT
}

@test "nonexistent version" {
stub_git_dir=
if [ ! -d "${BATS_TEST_DIRNAME}"/../.git ]; then
stub_git_dir="${BATS_TEST_DIRNAME}"/../.git
mkdir "$stub_git_dir"
fi

stub_repeated brew false
stub_ruby_build 'echo ERROR >&2 && exit 2' \
"--definitions : echo 1.8.7 1.9.3-p0 1.9.3-p194 2.1.2 | tr ' ' $'\\n'"

run rbenv-install 1.9.3
[ -z "$stub_git_dir" ] || rmdir "$stub_git_dir"

assert_failure
assert_output <<OUT
ERROR
Expand Down

0 comments on commit 3643c8e

Please sign in to comment.