2014-01-02 11:48:22 -05:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helper
|
|
|
|
|
|
|
|
create_executable() {
|
|
|
|
local bin="${PYENV_ROOT}/versions/${1}/bin"
|
|
|
|
mkdir -p "$bin"
|
|
|
|
touch "${bin}/$2"
|
|
|
|
chmod +x "${bin}/$2"
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "finds versions where present" {
|
2014-01-02 14:38:29 -05:00
|
|
|
create_executable "2.7" "python"
|
|
|
|
create_executable "2.7" "fab"
|
|
|
|
create_executable "3.4" "python"
|
|
|
|
create_executable "3.4" "py.test"
|
2014-01-02 11:48:22 -05:00
|
|
|
|
|
|
|
run pyenv-whence python
|
|
|
|
assert_success
|
|
|
|
assert_output <<OUT
|
2014-01-02 14:38:29 -05:00
|
|
|
2.7
|
|
|
|
3.4
|
2014-01-02 11:48:22 -05:00
|
|
|
OUT
|
|
|
|
|
2014-01-02 14:38:29 -05:00
|
|
|
run pyenv-whence fab
|
|
|
|
assert_success "2.7"
|
2014-01-02 11:48:22 -05:00
|
|
|
|
2014-01-02 14:38:29 -05:00
|
|
|
run pyenv-whence py.test
|
|
|
|
assert_success "3.4"
|
2014-01-02 11:48:22 -05:00
|
|
|
}
|