make asserts count for have_xpath
This commit is contained in:
parent
47c0b9520f
commit
50c5d50ca7
@ -81,12 +81,12 @@ module Webrat
|
|||||||
|
|
||||||
def assert_have_xpath(expected, &block)
|
def assert_have_xpath(expected, &block)
|
||||||
hs = HaveXpath.new(expected, &block)
|
hs = HaveXpath.new(expected, &block)
|
||||||
raise Test::Unit::AssertionFailedError.new(hs.failure_message) unless hs.matches?(response_body)
|
assert hs.matches?(response_body), hs.failure_message
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_have_no_xpath(expected, &block)
|
def assert_have_no_xpath(expected, &block)
|
||||||
hs = HaveXpath.new(expected, &block)
|
hs = HaveXpath.new(expected, &block)
|
||||||
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user