make asserts count for have_tag

This commit is contained in:
Amos King 2009-01-13 22:25:34 -06:00
parent e864d56079
commit 47c0b9520f
1 changed files with 2 additions and 2 deletions

View File

@ -57,14 +57,14 @@ module Webrat
# the supplied tag with the associated selectors
def assert_have_tag(name, attributes = {})
ht = HaveTag.new([name, attributes])
raise Test::Unit::AssertionFailedError.new(ht.failure_message) unless ht.matches?(response_body)
assert ht.matches?(response_body), ht.failure_message
end
# Asserts that the body of the response
# does not contain the supplied string or regepx
def assert_have_no_tag(name, attributes = {})
ht = HaveTag.new([name, attributes])
raise Test::Unit::AssertionFailedError.new(ht.negative_failure_message) if ht.matches?(response_body)
assert !ht.matches?(response_body), ht.negative_failure_message
end
end