Tuesday, 13 August 2013

Rspec spec_helper configuration issue: undefined method `syntax=' for # (NoMethodError)

Rspec spec_helper configuration issue: undefined method `syntax=' for #
(NoMethodError)

I am trying to confirm a function was called in a controller method with
an rspec test. To do this, I'm following the relishapp documentation for
setting up message expectations.
However, I'm having trouble adding this snippet to spec_helper.rb:
config.mock_with :rspec do |mocks|
mocks.syntax = :should
end
While simply config.mock_with :rspec was already in the file with no
problems caused, adding the snippet above and running rspec causes the
following error to appear:
You are using WebMock 1.12.3. VCR is known to work with WebMock >= 1.8.0,
< 1.12. It may not work with this version.
/Users/user/rails_projects/project/spec/spec_helper.rb:100:in `block (2
levels) in <top (required)>': undefined method `syntax=' for
#<RSpec::Mocks::Configuration:memory_location> (NoMethodError)
How can I fix this issue?

No comments:

Post a Comment