Created
December 17, 2012 14:24
-
-
Save timonv/4318642 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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