From aec889a14d81261f9f84591cd00533fc3d6f44cf Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 23 Feb 2009 22:14:58 -0500 Subject: [PATCH] Always deal with one query selector (a String, not an Array) --- lib/webrat/core/matchers/have_xpath.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/webrat/core/matchers/have_xpath.rb b/lib/webrat/core/matchers/have_xpath.rb index 2ddad4b..c31fdd0 100644 --- a/lib/webrat/core/matchers/have_xpath.rb +++ b/lib/webrat/core/matchers/have_xpath.rb @@ -37,7 +37,7 @@ module Webrat @query = query end - add_options_conditions_to(@query.first) + add_options_conditions_to(@query) @document = Webrat.rexml_document(stringlike) @@ -52,12 +52,12 @@ module Webrat def nokogiri_matches(stringlike) if Nokogiri::XML::NodeSet === stringlike - @query = query.map { |q| q.gsub(%r'//', './') } + @query = query.gsub(%r'//', './') else @query = query end - add_options_conditions_to(@query.first) + add_options_conditions_to(@query) @document = Webrat::XML.document(stringlike) @document.xpath(*@query) @@ -88,7 +88,7 @@ module Webrat end def query - [@expected].flatten.compact + @expected end # ==== Returns