tmux-yank-integration spec

This commit is contained in:
Jorge Morante 2016-07-15 08:32:11 +02:00
parent 36c0d1f9d7
commit f277fbc42c
4 changed files with 38 additions and 1 deletions

7
test/conf/tmux-yank.conf Normal file
View File

@ -0,0 +1,7 @@
set -g prefix C-a
bind-key -t vi-copy "y" copy-pipe "/home/vagrant/shared/test/stubs/tmux-yank.sh"
bind-key -t emacs-copy "y" copy-pipe "/home/vagrant/shared/test/stubs/tmux-yank.sh"
bind y run-shell "/home/vagrant/shared/test/stubs/tmux-yank.sh"
bind Y run-shell "/home/vagrant/shared/test/stubs/tmux-yank.sh"
run /home/vagrant/shared/tmux-fingers.tmux

View File

@ -21,4 +21,3 @@ expect {
}
exit $exit_code;

View File

@ -0,0 +1,28 @@
#!/usr/bin/env expect
set timeout 1;
set tmux_prefix "";
source "./test/helpers.exp"
exec "tmux kill-session -t test";
exec "rm -rf /tmp/tmux-yank-result"
spawn tmux -f ./test/conf/tmux-yank.conf new -s test;
sleep 0.5;
init_pane
exec "cat ./test/fixtures/grep-output";
invoke_fingers;
send "i";
sleep 0.5;
exec "cat /tmp/tmux-yank-result";
expect {
"tmux-yank yolo" { exit_ok }
timeout { exit_fail }
}
exit $exit_code;
set timeout 1;

3
test/stubs/tmux-yank.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
echo "tmux-yank yolo" > /tmp/tmux-yank-result