From 85f304ef3bbfc4bc28243a480e42a75de9222337 Mon Sep 17 00:00:00 2001 From: Richie Thomas Date: Sat, 15 Oct 2022 11:11:48 -0500 Subject: [PATCH] Prefer local over global version file --- test/version.bats | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/version.bats b/test/version.bats index f75af978..6df01abd 100644 --- a/test/version.bats +++ b/test/version.bats @@ -36,3 +36,12 @@ setup() { run rbenv-version assert_success "1.9.3 (set by ${RBENV_ROOT}/version)" } + +@test "prefer local over global file" { + create_version "1.9.3" + create_version "3.0.0" + cat > ".ruby-version" <<<"1.9.3" + cat > "${RBENV_ROOT}/version" <<<"3.0.0" + run rbenv-version + assert_success "1.9.3 (set by ${PWD}/.ruby-version)" +}