1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 07:43:46 -05:00

Fix emulating the scenario where system Ruby is missing on OpenBSD

On other systems, we expected to find system Ruby in `/usr/bin`, but in
OpenBSD 5.4 it will be found in `/usr/local/bin`.

This replaces the limited USRBIN_ALT hack with a more generic
`path_without` function that will ensure that the given executable is
not present in the resulting PATH even if it's found in multiple
system paths.
This commit is contained in:
Mislav Marohnić
2014-01-02 22:30:21 +01:00
parent 3dc0005032
commit 1e1c9cb0dc
2 changed files with 23 additions and 10 deletions

View File

@@ -25,15 +25,6 @@ load test_helper
}
@test "prefix for invalid system" {
USRBIN_ALT="${RBENV_TEST_DIR}/usr-bin-alt"
mkdir -p "$USRBIN_ALT"
for util in head readlink greadlink; do
if [ -x "/usr/bin/$util" ]; then
ln -s "/usr/bin/$util" "${USRBIN_ALT}/$util"
fi
done
PATH_WITHOUT_RUBY="${PATH/\/usr\/bin:/$USRBIN_ALT:}"
PATH="$PATH_WITHOUT_RUBY" run rbenv-prefix system
PATH="$(path_without ruby)" run rbenv-prefix system
assert_failure "rbenv: system version not found in PATH"
}