-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError: undefined method `equivalent_to?' #25
Comments
Noticed this as well using rspec 2.14, rails 3.1.12, nokogiri 1.5.7, equivalent-xml 0.5.1 Likely not related to rspec/rails version. |
This seems to be another battle in the war to provide seamless compatibility with both RSpec 2 and 3. I thought I had it fixed, but I'll keep looking into it. |
The workaround that seemed to work for me, change the require line to:
|
Me too. rspec-rails 3.0.2, rspec-core 3.0.4. |
That require change worked for me also. ruby-2.1.2
rspec-rails (3.1.0)
rspec-core (3.1.0) |
Facing same issue with |
This issue has been stagnant for a while, so I'm going to close it. I think the answer is to explicitly require |
@mbklein If that's the case I'd suggest trying to catch that with a more helpful error message. Error messages are important! |
@mbklein it would be good to update the readme to reflect this. |
Worth noting that this happens because matchers are only loaded if this gem detects that RSpec is defined: if defined?(::RSpec::Matchers) or defined?(::Spec::Matchers)
require 'equivalent-xml/rspec_matchers'
end But the issue here is that, anyone using the standard Ruby Coding Guidelines and Rubocop usually maintains a Gemfile that makes Bundler load One way EquivalentXml could handle this situation (without requiring everyone to explicitly require the matchers) is by doing something like this: begin
require 'rspec'
require 'equivalent-xml/rspec_matchers'
rescue LoadError
end |
Ran into:
When using with rspec. I was able to fix this by adding
require 'equivalent-xml/rspec_matchers'
to my spec_helper.rb file. I didn't have require either matchers or equivalent-xml as per the README.This was using rspec 2.99 and rails 4.1.5.
The text was updated successfully, but these errors were encountered: