Skip to content

Instantly share code, notes, and snippets.

@timonv
Created December 17, 2012 14:24
Show Gist options
  • Save timonv/4318642 to your computer and use it in GitHub Desktop.
Save timonv/4318642 to your computer and use it in GitHub Desktop.
def wait_for(klass, objects, assert = Proc.new { |x| x.present? }, retries = 10)
retries.times do |i|
break if assert.call(klass.send(objects))
sleep i * 0.1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment