From 51e8755634a5ad3651ab3758d898065d769960eb Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Sun, 29 Jan 2017 10:42:28 -0700 Subject: [PATCH] TerminalSession methods return self to support chaining --- spec/terminal_session.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/terminal_session.rb b/spec/terminal_session.rb index ee0bca1..733728b 100644 --- a/spec/terminal_session.rb +++ b/spec/terminal_session.rb @@ -10,14 +10,20 @@ class TerminalSession def run_command(command) send_string(command) send_keys('enter') + + self end def send_string(str) tmux_command("send-keys -t 0 -l '#{str.gsub("'", "\\'")}'") + + self end def send_keys(*keys) tmux_command("send-keys -t 0 #{keys.join(' ')}") + + self end def content(esc_seqs: false) @@ -29,6 +35,8 @@ class TerminalSession def clear send_keys('C-l') sleep(0.1) until content == '' + + self end def destroy