mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-09-06 18:06:58 +00:00
add removal procedure
This commit is contained in:
30
tests/expect_successful_clean_plugins
Executable file
30
tests/expect_successful_clean_plugins
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env expect
|
||||
|
||||
# disables script output
|
||||
log_user 0
|
||||
|
||||
spawn tmux
|
||||
|
||||
# Waiting for tmux to attach. If this is not done, next command, `send` will
|
||||
# not work properly.
|
||||
sleep 1
|
||||
|
||||
# this is tmux prefix + U
|
||||
send "Y"
|
||||
|
||||
set timeout 5
|
||||
|
||||
expect {
|
||||
"Removing \"tmux-example-plugin\"" {
|
||||
expect {
|
||||
"\"tmux-example-plugin\" clean success" {
|
||||
expect { "Done, press ENTER to continue." { exit 0 } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
timeout {
|
||||
puts "Plugin update prompt timeout";
|
||||
exit 1
|
||||
}
|
||||
}
|
32
tests/test_plugin_clean.sh
Executable file
32
tests/test_plugin_clean.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$CURRENT_DIR"/helpers.sh
|
||||
|
||||
manually_install_the_plugin() {
|
||||
rm -rf ~/.tmux/plugins/
|
||||
mkdir -p ~/.tmux/plugins/
|
||||
cd ~/.tmux/plugins/
|
||||
git clone --quiet https://github.com/tmux-plugins/tmux-example-plugin
|
||||
}
|
||||
|
||||
test_plugin_installation() {
|
||||
set_tmux_conf_helper <<- HERE
|
||||
run-shell "$PWD/tpm"
|
||||
HERE
|
||||
|
||||
manually_install_the_plugin
|
||||
|
||||
# opens tmux and test it with `expect`
|
||||
"$CURRENT_DIR"/expect_successful_clean_plugins ||
|
||||
fail_helper "Clean fails"
|
||||
|
||||
teardown_helper
|
||||
}
|
||||
|
||||
main() {
|
||||
test_plugin_installation
|
||||
exit_value_helper
|
||||
}
|
||||
main
|
Reference in New Issue
Block a user