Make test cases less susceptible to timeout errors

This commit is contained in:
Junegunn Choi 2016-10-22 00:01:21 +09:00
parent 0a8d2996dc
commit 400e443a0a
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -136,8 +136,10 @@ class Tmux
def prepare
tries = 0
begin
self.send_keys 'C-u', 'hello', 'Right'
self.until { |lines| lines[-1].end_with?('hello') }
self.until do |lines|
self.send_keys 'C-u', 'hello'
lines[-1].end_with?('hello')
end
rescue Exception
(tries += 1) < 5 ? retry : raise
end