spec: add a wait_until helper

This commit is contained in:
Pierre de La Morinerie 2019-06-04 16:17:21 +02:00
parent e870ba186f
commit c2fcc6057e

View file

@ -67,6 +67,13 @@ module FeatureHelpers
$stderr.write 'Spec paused. Press enter to continue:'
$stdin.gets
end
def wait_until
Timeout.timeout(Capybara.default_max_wait_time) do
sleep(0.1) until (value = yield)
value
end
end
end
RSpec.configure do |config|