lib/cistern/wait_for.rb in cistern-2.2.3 vs lib/cistern/wait_for.rb in cistern-2.2.4
- old
+ new
@@ -21,14 +21,14 @@
def timeout_error=(timeout_error)
@timeout_error = timeout_error
end
def timeout_error
- @timeout_error || self.const_defined?(:Timeout) && self.const_get(:Timeout) || ::Timeout::Error
+ @timeout_error || self.const_defined?(:Timeout) && const_get(:Timeout) || ::Timeout::Error
end
- def wait_for(timeout = self.timeout, interval = self.poll_interval, &block)
+ def wait_for(timeout = self.timeout, interval = poll_interval, &_block)
duration = 0
start = Time.now
until yield || duration > timeout
sleep(interval.to_f)
@@ -36,10 +36,10 @@
end
duration > timeout ? false : duration
end
- def wait_for!(timeout = self.timeout, interval = self.poll_interval, &block)
- wait_for(timeout, interval, &block) || raise(timeout_error, "wait_for(#{timeout}) exceeded")
+ def wait_for!(timeout = self.timeout, interval = poll_interval, &block)
+ wait_for(timeout, interval, &block) || fail(timeout_error, "wait_for(#{timeout}) exceeded")
end
end
end