In my cucumber hooks file, I had this code under RSpec 2:
After do
begin
Challenge.unstub(:current)
rescue RSpec::Mocks::MockExpectationError
end
end
After upgrading to RSpec 3, I get a deprecation warning:
DEPRECATION: Using unstub from rspec-mocks' old :should syntax without
explicitly enabling the syntax is deprecated. Use
allow(...).to_receive(...).and_call_original or explicitly enable :should
instead. Called from /Users/grant/xx/features/support/hooks.rb:37:in block
in <top (required)>.
So I followed that, changing the offending line instead to:
allow(Challenge).to receive(:current).and_call_original
But now I get:
undefined method allow for #<Cucumber::Rails::World:0x007facbed9f1d0>
(NoMethodError)
I've tried adding "include RSpec::Matchers" a few different ways, but it
doesn't change anything.
I'm kind of stuck. Can anyone show me the way?
-Grant
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/1dbbcdc2-d996-4d8a-b03f-5a8f6b1073a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.