Sha256: cf767eb72b01bf11b38035881eb3346476f6f951e6941c176b4921929f781424
Contents?: true
Size: 467 Bytes
Versions: 22
Compression:
Stored size: 467 Bytes
Contents
require 'timeout' module CellectHelper 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, 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 }" raise e end end
Version data entries
22 entries across 22 versions & 2 rubygems