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

Utilize the new expect syntax instead of should #28

Closed gabrielecirulli closed 10 years ago

gabrielecirulli commented 10 years ago

The latest RSpec releases have deprecated the should method in favor of expect, and RSpec now offers an option to fully disable the should syntax in order to future-proof your specs.

You can enable it in spec_helper.rb like such:

config.expect_with :rspec do |c|
  c.syntax = :expect
end

Having this option enabled causes some trouble with this gem. Some tests will fail with the following error:

NoMethodError: undefined method `should' for #<RSpec::Matchers::NokogiriMatcher:0x0000010ab32468>

This happens because this gem still uses the old should syntax. The only way to get the tests working is to remove the option to disable the syntax.

Would you guys consider converting your code to expect?

kucaahbe commented 10 years ago

Yes, just released "0.5.0" version with expect syntax support.

gabrielecirulli commented 10 years ago

Thanks!