Skip to content

Commit

Permalink
adding in failure messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gaffo committed Dec 27, 2008
1 parent 83fd944 commit a954b02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/webrat/core/matchers/have_content.rb
Expand Up @@ -54,13 +54,15 @@ def contain(content)
# Asserts that the body of the response contain
# the supplied string or regexp
def assert_contain(content)
assert(contain(content))
hc = HasContent.new(content)
assert(hc.matches?(content), hc.failure_message)
end

# Asserts that the body of the response
# does not contain the supplied string or regepx
def assert_not_contain(content)
assert(!contain(content))
hc = HasContent.new(content)
assert(!hc.matches?(content), hc.negative_failure_message)
end

end
Expand Down

0 comments on commit a954b02

Please sign in to comment.