Skip to content

Instantly share code, notes, and snippets.

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