Skip to content

Instantly share code, notes, and snippets.

@mkb
Created August 21, 2012 01:49
Show Gist options
  • Select an option

  • Save mkb/3410491 to your computer and use it in GitHub Desktop.

Select an option

Save mkb/3410491 to your computer and use it in GitHub Desktop.
RSpec expectations don't call the original method
# This line in my test...
EY::Statsd.should_receive(:push)
# ...causes this line in my app to fail...
EY::Statsd.push(:keymaster).increment
# The fix is...
EY::Statsd.should_receive(:push).and_return(stub(:increment => nil))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment