Skip to content

Instantly share code, notes, and snippets.

@mattwynne
Created June 7, 2010 15:30
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 mattwynne/428801 to your computer and use it in GitHub Desktop.
Save mattwynne/428801 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spec'
class Baz
def call_foo_on(subject, &block)
subject.foo(block)
end
end
describe Baz do
it "passes the expected block to the collaborator" do
the_block = Proc.new {}
collaborator = mock
collaborator.should_receive(:foo).with(the_block)
Baz.new.call_foo_on(collaborator, &the_block)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment