mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 15:23:53 -05:00
Allow explicit target directory argument to rbenv-version-file
Can be used for `.ruby-version` file lookup in the ancestry of a specific directory. In this mode of operation, global version files aren't taken into consideration, and the command fails unless a local version file was found.
This commit is contained in:
@@ -97,3 +97,14 @@ create_file() {
|
||||
RBENV_DIR="${RBENV_TEST_DIR}/widget/blank" run rbenv-version-file
|
||||
assert_success "${RBENV_TEST_DIR}/project/.ruby-version"
|
||||
}
|
||||
|
||||
@test "finds version file in target directory" {
|
||||
create_file "project/.ruby-version"
|
||||
run rbenv-version-file "${PWD}/project"
|
||||
assert_success "${RBENV_TEST_DIR}/project/.ruby-version"
|
||||
}
|
||||
|
||||
@test "fails when no version file in target directory" {
|
||||
run rbenv-version-file "$PWD"
|
||||
assert_failure ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user