kucaahbe / rspec-html-matchers

Old school have_tag, with_tag(and more) matchers for rspec 3 (Nokogiri powered)
http://rubygems.org/gems/rspec-html-matchers
MIT License
199 stars 90 forks source link

Fixes initialization code if cucumber and rspec are used in parallel #32

Closed arfl closed 9 years ago

arfl commented 9 years ago

Hello!

We use cucumber as well as rspec for our test suite. But I was not able to use this gem because of the initialization code you use here. So starting rspecs I get the following error gems/rspec-html-matchers-0.6.1/lib/rspec-html-matchers.rb:564:in <top (required)>': undefined method 'World' for main:Object (NoMethodError). So, in order to get it working I had to set gem 'rspec-html-matchers', require: false in my Gemfile and do the following in my rails_helper.rb:

def World(*); end
require 'rspec-html-matchers'
config.include RSpec::HtmlMatchers

And this code is really dirty! I am not a big fan of doing everything automatically and would rather include html matchers explicitly. But in order to not break the running code of users using this library I just rescued from the NoMethodError in my pull request.

Thank you.

Andreas

kucaahbe commented 9 years ago

Hello @arfl , thanks for PR and sorry for response absence. Can't merge PR because there was a bit different plan about such an issue: release next minor version with all this configuration hassle moved to user, so no automatic stuff any more. As soon as gem uses semantic versioning such changes should not be a big surprise for users and actual fix is pretty straightforward. Thanks for your attention on this, whithout you the idea to remove self-setup could remain unimplemented!

So fix in 0.7.0 version.

arfl commented 9 years ago

Sounds good...