2014-01-02 11:48:22 -05:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
|
|
|
|
@test "default" {
|
2016-03-01 20:39:52 -05:00
|
|
|
run pyenv-global
|
2014-01-02 11:48:22 -05:00
|
|
|
assert_success
|
|
|
|
assert_output "system"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "read PYENV_ROOT/version" {
|
|
|
|
mkdir -p "$PYENV_ROOT"
|
|
|
|
echo "1.2.3" > "$PYENV_ROOT/version"
|
|
|
|
run pyenv-global
|
|
|
|
assert_success
|
|
|
|
assert_output "1.2.3"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "set PYENV_ROOT/version" {
|
|
|
|
mkdir -p "$PYENV_ROOT/versions/1.2.3"
|
|
|
|
run pyenv-global "1.2.3"
|
|
|
|
assert_success
|
2016-03-01 20:39:52 -05:00
|
|
|
run pyenv-global
|
2014-01-02 11:48:22 -05:00
|
|
|
assert_success "1.2.3"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "fail setting invalid PYENV_ROOT/version" {
|
|
|
|
mkdir -p "$PYENV_ROOT"
|
|
|
|
run pyenv-global "1.2.3"
|
|
|
|
assert_failure "pyenv: version \`1.2.3' not installed"
|
|
|
|
}
|