spec/support/cellect_helper.rb in cellect-client-1.3.3 vs spec/support/cellect_helper.rb in cellect-client-2.0.0.beta1

- old
+ new

@@ -1,17 +1,17 @@ require 'timeout' module CellectHelper - def pass_until(&block) - Timeout::timeout(1) do + def pass_until(timeout: 1, &block) + Timeout::timeout(timeout) do Thread.pass until block.call end rescue => e puts "Timeout waiting for condition #{ block.inspect }" raise e end - def pass_until_state_of(obj, is:) + def pass_until_state_of(obj, timeout: 1, is:) Timeout::timeout(1) do Thread.pass until obj.state == is end rescue => e puts "Timeout waiting for #{ obj.inspect } to be #{ is }"