mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-14 06:13:53 -05:00
upgrade bats to v1.10.0
fix bats warnings
This commit is contained in:
@@ -60,17 +60,19 @@ create_executable() {
|
||||
}
|
||||
|
||||
@test "doesn't include current directory in PATH search" {
|
||||
bats_require_minimum_version 1.5.0
|
||||
mkdir -p "$PYENV_TEST_DIR"
|
||||
cd "$PYENV_TEST_DIR"
|
||||
touch kill-all-humans
|
||||
chmod +x kill-all-humans
|
||||
PATH="$(path_without "kill-all-humans")" PYENV_VERSION=system run pyenv-which kill-all-humans
|
||||
PATH="$(path_without "kill-all-humans")" PYENV_VERSION=system run -127 pyenv-which kill-all-humans
|
||||
assert_failure "pyenv: kill-all-humans: command not found"
|
||||
}
|
||||
|
||||
@test "version not installed" {
|
||||
bats_require_minimum_version 1.5.0
|
||||
create_executable "3.4" "py.test"
|
||||
PYENV_VERSION=3.3 run pyenv-which py.test
|
||||
PYENV_VERSION=3.3 run -127 pyenv-which py.test
|
||||
assert_failure <<OUT
|
||||
pyenv: version \`3.3' is not installed (set by PYENV_VERSION environment variable)
|
||||
pyenv: py.test: command not found
|
||||
@@ -84,8 +86,9 @@ OUT
|
||||
}
|
||||
|
||||
@test "versions not installed" {
|
||||
bats_require_minimum_version 1.5.0
|
||||
create_executable "3.4" "py.test"
|
||||
PYENV_VERSION=2.7:3.3 run pyenv-which py.test
|
||||
PYENV_VERSION=2.7:3.3 run -127 pyenv-which py.test
|
||||
assert_failure <<OUT
|
||||
pyenv: version \`2.7' is not installed (set by PYENV_VERSION environment variable)
|
||||
pyenv: version \`3.3' is not installed (set by PYENV_VERSION environment variable)
|
||||
@@ -100,22 +103,25 @@ OUT
|
||||
}
|
||||
|
||||
@test "no executable found" {
|
||||
bats_require_minimum_version 1.5.0
|
||||
create_executable "2.7" "py.test"
|
||||
PYENV_VERSION=2.7 run pyenv-which fab
|
||||
PYENV_VERSION=2.7 run -127 pyenv-which fab
|
||||
assert_failure "pyenv: fab: command not found"
|
||||
}
|
||||
|
||||
@test "no executable found for system version" {
|
||||
PATH="$(path_without "rake")" PYENV_VERSION=system run pyenv-which rake
|
||||
bats_require_minimum_version 1.5.0
|
||||
PATH="$(path_without "rake")" PYENV_VERSION=system run -127 pyenv-which rake
|
||||
assert_failure "pyenv: rake: command not found"
|
||||
}
|
||||
|
||||
@test "executable found in other versions" {
|
||||
bats_require_minimum_version 1.5.0
|
||||
create_executable "2.7" "python"
|
||||
create_executable "3.3" "py.test"
|
||||
create_executable "3.4" "py.test"
|
||||
|
||||
PYENV_VERSION=2.7 run pyenv-which py.test
|
||||
PYENV_VERSION=2.7 run -127 pyenv-which py.test
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
pyenv: py.test: command not found
|
||||
@@ -188,11 +194,12 @@ exit
|
||||
}
|
||||
|
||||
@test "skip advice supresses error messages" {
|
||||
bats_require_minimum_version 1.5.0
|
||||
create_executable "2.7" "python"
|
||||
create_executable "3.3" "py.test"
|
||||
create_executable "3.4" "py.test"
|
||||
|
||||
PYENV_VERSION=2.7 run pyenv-which py.test --skip-advice
|
||||
PYENV_VERSION=2.7 run -127 pyenv-which py.test --skip-advice
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
pyenv: py.test: command not found
|
||||
|
||||
Reference in New Issue
Block a user