Module: Waiter
- Defined in:
- lib/waiter.rb,
lib/version.rb,
lib/timeout_error.rb
Defined Under Namespace
Classes: ChainableWait, TimeoutError, WaitExpectationTarget
Constant Summary collapse
- VERSION =
'1.0.4'
Instance Method Summary collapse
-
#wait(opts = {}, &block) ⇒ Object
Wrapper for RSpec expectations that allows waiting/polling.
Instance Method Details
#wait(opts = {}, &block) ⇒ Object
Wrapper for RSpec expectations that allows waiting/polling.
The default timeout is 15 seconds, polling every 1 second.
To adjust the timeout/polling, simple chain methods are supported.
The up_to method accepts an Integer and adjusts the timeout. Use the every method with an Integer to adjust the polling time.
You do not have to use both methods, you can adjust one or the other. They can also be used in any order.
You can also pass a block to be evaluated, using until, until it is true.
49 50 51 |
# File 'lib/waiter.rb', line 49 def wait(opts = {}, &block) ChainableWait.new(opts) end |