Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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