Optimize become_closed matcher

This commit is contained in:
Andrey Botalov 2014-06-26 21:55:45 +03:00
parent dd1f79bd62
commit ef7ecf925d
1 changed files with 3 additions and 2 deletions

View File

@ -132,10 +132,11 @@ module Capybara
def matches?(window)
@window = window
start_time = Time.now
while window.exists? && (Time.now - start_time) < @wait_time
while window.exists?
return false if (Time.now - start_time) > @wait_time
sleep 0.05
end
window.closed?
true
end
def failure_message