mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-11 13:03: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:
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
export PYENV_ROOT="${TMP}/pyenv"
|
||||
|
||||
setup() {
|
||||
_setup() {
|
||||
export PYENV_ROOT="${BATS_TEST_TMPDIR}/pyenv"
|
||||
stub pyenv-hooks 'install : true'
|
||||
stub pyenv-rehash true
|
||||
}
|
||||
@@ -39,8 +39,8 @@ stub_python_build() {
|
||||
run pyenv-install 3.4.1 3.4.2
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
python-build 3.4.1 ${TMP}/pyenv/versions/3.4.1
|
||||
python-build 3.4.2 ${TMP}/pyenv/versions/3.4.2
|
||||
python-build 3.4.1 ${BATS_TEST_TMPDIR}/pyenv/versions/3.4.1
|
||||
python-build 3.4.2 ${BATS_TEST_TMPDIR}/pyenv/versions/3.4.2
|
||||
OUT
|
||||
|
||||
unstub python-build
|
||||
@@ -54,7 +54,7 @@ OUT
|
||||
run pyenv-install 3.4.1 3.4.2
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
fail: python-build 3.4.1 ${TMP}/pyenv/versions/3.4.1
|
||||
fail: python-build 3.4.1 ${BATS_TEST_TMPDIR}/pyenv/versions/3.4.1
|
||||
OUT
|
||||
|
||||
unstub python-build
|
||||
|
||||
Reference in New Issue
Block a user