25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
526 B

  1. #!/usr/bin/env bats
  2. load test_helper
  3. create_executable() {
  4. local bin="${PYENV_ROOT}/versions/${1}/bin"
  5. mkdir -p "$bin"
  6. touch "${bin}/$2"
  7. chmod +x "${bin}/$2"
  8. }
  9. @test "finds versions where present" {
  10. create_executable "2.7" "python"
  11. create_executable "2.7" "fab"
  12. create_executable "3.4" "python"
  13. create_executable "3.4" "py.test"
  14. run pyenv-whence python
  15. assert_success
  16. assert_output <<OUT
  17. 2.7
  18. 3.4
  19. OUT
  20. run pyenv-whence fab
  21. assert_success "2.7"
  22. run pyenv-whence py.test
  23. assert_success "3.4"
  24. }