Skip to content

Instantly share code, notes, and snippets.

@tosch
Forked from anonymous/t.rb
Created August 17, 2010 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tosch/528730 to your computer and use it in GitHub Desktop.
Save tosch/528730 to your computer and use it in GitHub Desktop.
participant = ImageParticipant.new(opts)
# with error when reply_to_engine is not called
participant.should_receive(:reply_to_engine)
# if you know how the workitems instance should look like when passed to reply_to_engine:
participant.should_receive(:reply_to_engine).with(expected_workitem)
# if you don't care if reply_to_engine is actually called
participant.stub(:reply_to_engine)
# and now: call the method to be tested
participant.consume(workitem_before_consume)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment