mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-17 15:53:45 -05:00
Import tests from rbenv with sed -e s/rbenv/pyenv/g
This commit is contained in:
30
test/whence.bats
Normal file
30
test/whence.bats
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/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" {
|
||||
create_executable "1.8" "python"
|
||||
create_executable "1.8" "rake"
|
||||
create_executable "2.0" "python"
|
||||
create_executable "2.0" "rspec"
|
||||
|
||||
run pyenv-whence python
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
1.8
|
||||
2.0
|
||||
OUT
|
||||
|
||||
run pyenv-whence rake
|
||||
assert_success "1.8"
|
||||
|
||||
run pyenv-whence rspec
|
||||
assert_success "2.0"
|
||||
}
|
||||
Reference in New Issue
Block a user