Add tests for updating plugins

This commit is contained in:
Bruno Sutic
2014-08-05 21:44:25 +02:00
parent 08608064b2
commit bfdbfa46b9
4 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,61 @@
#!/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 "U"
set timeout 5
expect {
"Installed plugins" {
expect {
"\"tmux-example-plugin\"" {
expect {
"\"all\" - updates all plugins" {
expect { "ENTER - cancels" }
}
}
}
}
}
timeout {
puts "Plugin update prompt timeout";
exit 1
}
}
send "tmux-example-plugin\r"
expect {
"Updating \"tmux-example-plugin\"" {
expect {
"\"tmux-example-plugin\" update success" {
expect { "Done, press ENTER to continue." { exit 0 } }
}
}
}
timeout {
puts "Update all plugins timeout";
exit 1
}
}