1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 15:53:45 -05:00

Add a test to confirm the prefix doesn't work fine with /bin/ruby

This commit is contained in:
Yamashita, Yuu
2016-08-01 00:30:29 +00:00
parent 9fdce5d069
commit 2485257424
2 changed files with 10 additions and 1 deletions

View File

@@ -24,6 +24,15 @@ load test_helper
assert_success "$RBENV_TEST_DIR"
}
@test "prefix for system in /" {
mkdir -p "${RBENV_TEST_DIR}/bin"
touch "${RBENV_TEST_DIR}/bin/rbenv-which"
echo "echo /bin/ruby" >"${RBENV_TEST_DIR}/bin/rbenv-which"
chmod +x "${RBENV_TEST_DIR}/bin/rbenv-which"
RBENV_VERSION="system" run rbenv-prefix
assert_success "/"
}
@test "prefix for invalid system" {
PATH="$(path_without ruby)" run rbenv-prefix system
assert_failure "rbenv: system version not found in PATH"