From 50c5d50ca76b8dfab2d7000dbcd10866216b52d6 Mon Sep 17 00:00:00 2001 From: Amos King Date: Tue, 13 Jan 2009 22:25:44 -0600 Subject: [PATCH] make asserts count for have_xpath --- lib/webrat/core/matchers/have_xpath.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/webrat/core/matchers/have_xpath.rb b/lib/webrat/core/matchers/have_xpath.rb index cc15a7a..6f242b1 100644 --- a/lib/webrat/core/matchers/have_xpath.rb +++ b/lib/webrat/core/matchers/have_xpath.rb @@ -81,12 +81,12 @@ module Webrat def assert_have_xpath(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 def assert_have_no_xpath(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