adding in failure messages

This commit is contained in:
Mike Gaffney 2008-12-27 17:30:54 -06:00
parent 83fd944ecc
commit a954b02b22
1 changed files with 4 additions and 2 deletions

View File

@ -54,13 +54,15 @@ module Webrat
# 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