Blog Entry

rspec says: undefined method 'should_receive' for SomeClass

This took up an hour of my life today.

Here's the fix. At some point I'll go back and research Double Ruby to figure out what went wrong, but for now, tests are failing validly...

1
2
3
4
5
6
7
8
9
10
11
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -20,7 +20,7 @@ Spec::Runner.configure do |config|
config.use_instantiated_fixtures = false config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
- config.mock_with :rr
+# config.mock_with :rr
def set_current_user(user) stub(controller).current_user { user }