Top Level Namespace

Defined Under Namespace

Modules: Foodtaster

Instance Method Summary collapse

Instance Method Details

#wait_until(_timeout = 5) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/foodtaster/rspec/matchers/simple_matchers.rb', line 75

def wait_until(_timeout = 5)
  begin
    timeout _timeout do
      until (result = yield)
        sleep 0.5
      end
      result
    end
  rescue Timeout::Error
    nil
  end
end