Skip to content

Instantly share code, notes, and snippets.

Saumya Negi xam7247

  • Mindtree Ltd
  • Manchester, UK
Block or report user

Report or block xam7247

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@xam7247
xam7247 / async_helper.txt
Last active Jun 1, 2016 — forked from mattwynne/gist:1228927
eventually helper method for making assertions against asynchronous systems
View async_helper.txt
# 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
You can’t perform that action at this time.