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

undefined method `negative_failure_message' #6

Closed arielvalentin closed 13 years ago

arielvalentin commented 13 years ago

I am trying to write an assertion that ensures elements are missing from the view, for example

rendered.should have_tag("select[name=menu_options]") do without_tag("option[value=1]") end

When I run the spec the test fails, however it fails for an undesirable reason, it seems that Rspec::NegativeExpectationHandler is expecting the NogokiriMatcher to have one of two methods, neither of which is present on the object:

    message ||= matcher.respond_to?(:failure_message_for_should_not) ?
                matcher.failure_message_for_should_not :
                matcher.negative_failure_message

That results in the following error:

NoMethodError: undefined method negative_failure_message' for #<RSpec::Matchers::NokogiriMatcher:0x10a13dd68> /Users/avalentin/.rvm/gems/ruby-1.8.7-p352@rails3/gems/rspec-expectations-2.5.0/lib/rspec/expectations/handler.rb:39:inhandle_matcher' /Users/avalentin/.rvm/gems/ruby-1.8.7-p352@rails3/gems/rspec-expectations-2.5.0/lib/rspec/expectations/extensions/kernel.rb:50:in should_not' /Users/avalentin/.rvm/gems/ruby-1.8.7-p352@rails3/gems/rspec2-rails-views-matchers-0.1.6/lib/rspec/rails/views/matchers/have_tag.rb:176:inwithout_tag'

kucaahbe commented 13 years ago

this already fixed in master branch, it is pretty stable and you can use it

arielvalentin commented 13 years ago

Do you have a scheduled release with this fix or do I have to bind to that hash tag?

kucaahbe commented 13 years ago

this will be released in 0.2.0, but when I don't know yet:( for now it is only solution to use master

kucaahbe commented 13 years ago

0.2.0 released

arielvalentin commented 13 years ago

Thanks!