Skip to content

Instantly share code, notes, and snippets.

@mattwynne
mattwynne / gist:1228927
Created September 20, 2011 11:52
eventually helper method for making assertions against asynchronous systems
# usage:
# it "should return a result of 5" do
# eventually { long_running_thing.result.should eq(5) }
# end
module AsyncHelper
def eventually(:options = {})
timeout = options[:timeout] || 2
interval = options[:interval] || 0.1
time_limit = Time.now + timeout
loop do
@prehensile
prehensile / GenerateParentzoneGalleryImageLinks.user.js
Last active July 23, 2024 14:06
Userscript and instructions for downloading images from a ParentZone gallery