My configuration files for Debian/Ubuntu applications
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

68 řádky
1.5 KiB

  1. #!/usr/bin/env bash
  2. CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. TPM_DIR="$PWD"
  4. PLUGINS_DIR="$HOME/.tmux/plugins"
  5. source "$CURRENT_DIR/helpers/helpers.sh"
  6. source "$CURRENT_DIR/helpers/tpm.sh"
  7. manually_install_the_plugin() {
  8. rm -rf "$PLUGINS_DIR"
  9. mkdir -p "$PLUGINS_DIR"
  10. cd "$PLUGINS_DIR"
  11. git clone --quiet https://github.com/tmux-plugins/tmux-example-plugin
  12. }
  13. # TMUX KEY-BINDING TESTS
  14. test_plugin_uninstallation_via_tmux_key_binding() {
  15. set_tmux_conf_helper <<- HERE
  16. set -g mode-keys vi
  17. run-shell "$TPM_DIR/tpm"
  18. HERE
  19. manually_install_the_plugin
  20. "$CURRENT_DIR/expect_successful_clean_plugins" ||
  21. fail_helper "[key-binding] clean fails"
  22. teardown_helper
  23. }
  24. # SCRIPT TESTS
  25. test_plugin_uninstallation_via_script() {
  26. set_tmux_conf_helper <<- HERE
  27. set -g mode-keys vi
  28. run-shell "$TPM_DIR/tpm"
  29. HERE
  30. manually_install_the_plugin
  31. script_run_helper "$TPM_DIR/bin/clean_plugins" '"tmux-example-plugin" clean success' ||
  32. fail_helper "[script] plugin cleaning fails"
  33. teardown_helper
  34. }
  35. test_unsuccessful_plugin_uninstallation_via_script() {
  36. set_tmux_conf_helper <<- HERE
  37. set -g mode-keys vi
  38. run-shell "$TPM_DIR/tpm"
  39. HERE
  40. manually_install_the_plugin
  41. chmod 000 "$PLUGINS_DIR/tmux-example-plugin" # disable directory deletion
  42. local expected_exit_code=1
  43. script_run_helper "$TPM_DIR/bin/clean_plugins" '"tmux-example-plugin" clean fail' "$expected_exit_code" ||
  44. fail_helper "[script] unsuccessful plugin cleaning doesn't fail"
  45. chmod 755 "$PLUGINS_DIR/tmux-example-plugin" # enable directory deletion
  46. teardown_helper
  47. }
  48. run_tests