Skip to content

Instantly share code, notes, and snippets.

@agraves
Created February 7, 2012 22:48
Show Gist options
  • Save agraves/1762658 to your computer and use it in GitHub Desktop.
Save agraves/1762658 to your computer and use it in GitHub Desktop.
surprise
# incorrect
describe 'foo' do
it 'should bar' do
@foo = Factory(:foo)
@foo.bar
@foo.should_receive :bar # wrong
end
end
# correct
describe 'foo' do
it 'should bar' do
@foo = Factory(:foo)
@foo.should_receive :bar # has to PRECEDE the call
@foo.bar
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment