Hello,
I am currently using rspec and docker api to test docker container
(@container = Docker::Container.create & @container.start).
I would like to know if it is possible to wait a condition (port available
for example) to continue the test suite?
I saw this module rspec-wait ...
Thanks.
--
RSpec doesn’t have any built-in features for what you’re asking for, but
it’s easy enough to write it yourself:
require 'timeout'
module WaitHelpers
def wait_until(timeout)
timeout_time = Time.now + timeout
loop do
sleep 0.1
return if yield
raise Timeout::Error if Time.