make asserts count for have_selector

This commit is contained in:
Amos King 2009-01-13 22:25:22 -06:00
parent 3707262e72
commit e864d56079

View File

@ -38,14 +38,14 @@ module Webrat
# the supplied selector # the supplied selector
def assert_have_selector(expected) def assert_have_selector(expected)
hs = HaveSelector.new(expected) hs = HaveSelector.new(expected)
raise Test::Unit::AssertionFailedError.new(hs.failure_message) unless hs.matches?(response_body) assert hs.matches?(response_body), hs.failure_message
end end
# Asserts that the body of the response # Asserts that the body of the response
# does not contain the supplied string or regepx # does not contain the supplied string or regepx
def assert_have_no_selector(expected) def assert_have_no_selector(expected)
hs = HaveSelector.new(expected) hs = HaveSelector.new(expected)
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