Skip to content

Instantly share code, notes, and snippets.

@vanstee
Last active December 14, 2015 07:29
Show Gist options
  • Save vanstee/5050689 to your computer and use it in GitHub Desktop.
Save vanstee/5050689 to your computer and use it in GitHub Desktop.
class Item
def does_something
PublishingHouse.new(@document).publish
end
end
it 'publishes the document' do
publishing_house = stub('PublishingHouse')
publishing_house.should_receive(:publish).once
PublishingHouse.should_receive(:new).with(document) { publishing_house }
Item.new(document).does_something
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment