mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-17 07:43:46 -05:00
use BATS_FILE_TMPDIR in test/plugin test
use global setup with bats with possibility to add specific test file _setup use readlink in helper if realpath is not working as expected
This commit is contained in:
@@ -34,15 +34,15 @@ load test_helper
|
||||
}
|
||||
|
||||
@test "prefix for system in /" {
|
||||
mkdir -p "${BATS_TEST_DIRNAME}/libexec"
|
||||
cat >"${BATS_TEST_DIRNAME}/libexec/pyenv-which" <<OUT
|
||||
mkdir -p "${PYENV_TEST_DIR}/libexec"
|
||||
cat >"${PYENV_TEST_DIR}/libexec/pyenv-which" <<OUT
|
||||
#!/bin/sh
|
||||
echo /bin/python
|
||||
OUT
|
||||
chmod +x "${BATS_TEST_DIRNAME}/libexec/pyenv-which"
|
||||
chmod +x "${PYENV_TEST_DIR}/libexec/pyenv-which"
|
||||
PATH="${PYENV_TEST_DIR}/libexec:$PATH" PYENV_VERSION="system" run pyenv-prefix
|
||||
assert_success "/"
|
||||
rm -f "${BATS_TEST_DIRNAME}/libexec/pyenv-which"
|
||||
rm -f "${PYENV_TEST_DIR}/libexec/pyenv-which"
|
||||
}
|
||||
|
||||
@test "prefix for invalid system" {
|
||||
|
||||
Reference in New Issue
Block a user