make asserts count for have_xpath

This commit is contained in:
Amos King 2009-01-13 22:25:44 -06:00
parent 47c0b9520f
commit 50c5d50ca7

View File

@ -81,12 +81,12 @@ module Webrat
def assert_have_xpath(expected, &block) def assert_have_xpath(expected, &block)
hs = HaveXpath.new(expected, &block) hs = HaveXpath.new(expected, &block)
raise Test::Unit::AssertionFailedError.new(hs.failure_message) unless hs.matches?(response_body) assert hs.matches?(response_body), hs.failure_message
end end
def assert_have_no_xpath(expected, &block) def assert_have_no_xpath(expected, &block)
hs = HaveXpath.new(expected, &block) hs = HaveXpath.new(expected, &block)
raise Test::Unit::AssertionFailedError.new(hs.negative_failure_message) if hs.matches?(response_body) assert !hs.matches?(response_body), hs.negative_failure_message
end end
end end