Skip to content

Instantly share code, notes, and snippets.

@gerhard
Created May 30, 2012 23:38
Show Gist options
  • Save gerhard/2839581 to your computer and use it in GitHub Desktop.
Save gerhard/2839581 to your computer and use it in GitHub Desktop.
EM with Redis tests
def em(redis_url=REDIS_URL, &block)
EM.run do
redis = EM::Hiredis.connect(redis_url)
block.call(redis)
end
end
# ...
# fluffyness
# ...
it "returns keys for sources" do
em do |redis|
collector = VisitorsSources.new(redis)
collector.sources.callback do |sources|
@sources = sources
EM.stop
end
end
@sources.size.must_be :>, 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment