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
1 changed files with 2 additions and 2 deletions

View File

@ -38,14 +38,14 @@ module Webrat
# the supplied selector
def assert_have_selector(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
# Asserts that the body of the response
# does not contain the supplied string or regepx
def assert_have_no_selector(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