tpm/tests/test_plugin_update.sh

35 lines
830 B
Bash
Raw Normal View History

2014-08-05 15:44:25 -04:00
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2015-07-31 19:54:34 -04:00
TPM_DIR="$PWD"
PLUGINS_DIR="$HOME/.tmux/plugins"
2014-08-05 15:44:25 -04:00
2015-08-01 16:12:07 -04:00
source "$CURRENT_DIR/helpers/helpers.sh"
source "$CURRENT_DIR/helpers/tpm.sh"
2014-08-05 15:44:25 -04:00
manually_install_the_plugin() {
2015-07-31 19:54:34 -04:00
mkdir -p "$PLUGINS_DIR"
cd "$PLUGINS_DIR"
2014-08-05 15:44:25 -04:00
git clone --quiet https://github.com/tmux-plugins/tmux-example-plugin
}
test_plugin_installation() {
set_tmux_conf_helper <<- HERE
2015-07-06 19:49:33 -04:00
set -g @plugin "tmux-plugins/tmux-example-plugin"
2015-07-31 19:54:34 -04:00
run-shell "$TPM_DIR/tpm"
2014-08-05 15:44:25 -04:00
HERE
manually_install_the_plugin
# opens tmux and test it with `expect`
2015-07-31 19:54:34 -04:00
"$CURRENT_DIR/expect_successful_update_of_all_plugins" ||
2014-08-05 15:44:25 -04:00
fail_helper "Tmux 'update all plugins' fails"
2015-07-31 19:54:34 -04:00
"$CURRENT_DIR/expect_successful_update_of_a_single_plugin" ||
2014-08-05 15:44:25 -04:00
fail_helper "Tmux 'update single plugin' fails"
teardown_helper
}
2015-08-01 12:06:19 -04:00
run_tests