Maintenance: until_constant browser test helper method does not actually performs a Timout and can't handle nil as a result.
This commit is contained in:
parent
e6bc9280bd
commit
c6e11f3f4e
1 changed files with 9 additions and 2 deletions
|
@ -122,9 +122,16 @@ module BrowserTestHelper
|
||||||
#
|
#
|
||||||
def until_constant
|
def until_constant
|
||||||
previous = nil
|
previous = nil
|
||||||
loop do
|
timeout = __getobj__.instance_variable_get(:@timeout)
|
||||||
sleep __getobj__.instance_variable_get(:@interval)
|
interval = __getobj__.instance_variable_get(:@interval)
|
||||||
|
rounds = (timeout / interval).to_i
|
||||||
|
|
||||||
|
rounds.times do
|
||||||
|
sleep interval
|
||||||
|
|
||||||
latest = yield
|
latest = yield
|
||||||
|
|
||||||
|
next if latest.nil?
|
||||||
break if latest == previous
|
break if latest == previous
|
||||||
|
|
||||||
previous = latest
|
previous = latest
|
||||||
|
|
Loading…
Reference in a new issue