You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 rivejä
693 B

  1. #!/usr/bin/env bats
  2. load test_helper
  3. @test "commands" {
  4. run pyenv-commands
  5. assert_success
  6. assert_line "init"
  7. assert_line "rehash"
  8. assert_line "shell"
  9. refute_line "sh-shell"
  10. assert_line "echo"
  11. }
  12. @test "commands --sh" {
  13. run pyenv-commands --sh
  14. assert_success
  15. refute_line "init"
  16. assert_line "shell"
  17. }
  18. @test "commands in path with spaces" {
  19. path="${PYENV_TEST_DIR}/my commands"
  20. cmd="${path}/pyenv-sh-hello"
  21. mkdir -p "$path"
  22. touch "$cmd"
  23. chmod +x "$cmd"
  24. PATH="${path}:$PATH" run pyenv-commands --sh
  25. assert_success
  26. assert_line "hello"
  27. }
  28. @test "commands --no-sh" {
  29. run pyenv-commands --no-sh
  30. assert_success
  31. assert_line "init"
  32. refute_line "shell"
  33. }