Skip to content

Instantly share code, notes, and snippets.

@simongregory
Created October 9, 2012 15:18
Show Gist options
  • Save simongregory/3859469 to your computer and use it in GitHub Desktop.
Save simongregory/3859469 to your computer and use it in GitHub Desktop.
yielding a mock to a block
should "configure the Application with a consumer key and secret" do
credentials = {'consumer_key' => 'skeleton', 'consumer_secret' => 'closet'}
config = mock()
config.expects(:consumer_key=).with('skeleton').once
config.expects(:consumer_secret=).with('closet').once
service = mock()
service.stubs(:configure).yields(config)
Blah.store_consumer(credentials, service)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment