Skip to content

Commit

Permalink
make asserts count for have_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
adkron committed Jan 14, 2009
1 parent e864d56 commit 47c0b95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/webrat/core/matchers/have_tag.rb
Expand Up @@ -57,14 +57,14 @@ def have_tag(name, attributes = {}, &block)
# 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
Expand Down

0 comments on commit 47c0b95

Please sign in to comment.