Created
September 23, 2010 20:17
-
-
Save jonhinson/594273 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
# working on testing loops like the one below | |
# describe Foo do | |
# it "should write hi" do | |
# Bar.stubs(:create) | |
# Delayed::Job.stubs(:enqueue) | |
# Bar.stubs(:first).returns(Bar.new, nil) | |
# Foo.any_instance.stubs(:sleep) | |
# foo = Foo.new | |
# foo.should_receive(:puts).with("hi") | |
# foo.should_receive(:sleep).with(1) | |
# foo.foo | |
# end | |
# end | |
def foo | |
Bar.create | |
Delayed::Job.enqueue DeleteBarJob.new | |
while bar = Bar.first | |
puts "hi" | |
sleep 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oops