public
Last active

  • Download Gist
wait_steps.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require "timeout"
 
module WaitSteps
extend RSpec::Matchers::DSL
 
matcher :become_true do
match do |block|
begin
Timeout.timeout(Capybara.default_wait_time) do
sleep(0.1) until value = block.call
value
end
rescue TimeoutError
false
end
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.