Skip to content

Instantly share code, notes, and snippets.

@jwilger
Created August 27, 2011 18:39
Show Gist options
  • Save jwilger/1175717 to your computer and use it in GitHub Desktop.
Save jwilger/1175717 to your computer and use it in GitHub Desktop.
Yay for #tap
let(:some_thing) { mock_model(SomeThing) }
let(:exception) do
ActiveRecord::RecordInvalid.allocate.tap do |e|
e.stub!(record: some_thing)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment