Module: FluQ::Testing

Extended by:
Testing
Included in:
Testing
Defined in:
lib/fluq/testing.rb

Instance Method Summary collapse

Instance Method Details

#wait_until(opts = {}, &block) ⇒ Object



6
7
8
9
10
11
# File 'lib/fluq/testing.rb', line 6

def wait_until(opts = {}, &block)
  tick = opts[:tick] || 0.01
  max  = opts[:max]  || (tick * 50)
  Timeout.timeout(max) { sleep(tick) until block.call }
rescue Timeout::Error
end