I am using RSpec2 v2.13.1 and it seems that rspec-mocks ( https://github.com/rspec/rspec-mocks ) should be included in it. Of course, this is stated in my Gemfile.lock.
However, when I run my tests, I get
Failure/Error: allow(Notifier).to receive(:new_comment) { @decoy } NoMethodError: undefined method `allow' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x007fc302aeca78>
Here is the test I'm trying to run:
require 'spec_helper' describe CommentEvent do before(:each) do @event = FactoryGirl.build(:comment_event) @decoy = double('Resque::Mailer::MessageDecoy', :deliver => true)
The goal is to drown out the notifier and messages so that I can check if my CommentEvent class actually calls the first. I read in the rspec-mocks documentation that stubbing is not supported in before (: all), but it does not work in before (: each). Help!
Thanks for any info ...
source share