Sha256: e01b3d0baf45179be840c936a5a9c77994d2a787956610af375ad333637ce0cf
Contents?: true
Size: 504 Bytes
Versions: 8
Compression:
Stored size: 504 Bytes
Contents
module PageMagic # module WaitMethods - contains methods for waiting module WaitMethods # Wait until a the supplied block returns true # @example # wait_until do # (rand % 2) == 0 # end def wait_until(timeout_after: 5, retry_every: 1, &block) start_time = Time.now until Time.now > start_time + timeout_after return true if block.call == true sleep retry_every end fail TimeoutException, 'Action took to long' end end end
Version data entries
8 entries across 8 versions & 1 rubygems