Always deal with one query selector (a String, not an Array)
This commit is contained in:
parent
dad3da195c
commit
aec889a14d
@ -37,7 +37,7 @@ module Webrat
|
|||||||
@query = query
|
@query = query
|
||||||
end
|
end
|
||||||
|
|
||||||
add_options_conditions_to(@query.first)
|
add_options_conditions_to(@query)
|
||||||
|
|
||||||
@document = Webrat.rexml_document(stringlike)
|
@document = Webrat.rexml_document(stringlike)
|
||||||
|
|
||||||
@ -52,12 +52,12 @@ module Webrat
|
|||||||
|
|
||||||
def nokogiri_matches(stringlike)
|
def nokogiri_matches(stringlike)
|
||||||
if Nokogiri::XML::NodeSet === stringlike
|
if Nokogiri::XML::NodeSet === stringlike
|
||||||
@query = query.map { |q| q.gsub(%r'//', './') }
|
@query = query.gsub(%r'//', './')
|
||||||
else
|
else
|
||||||
@query = query
|
@query = query
|
||||||
end
|
end
|
||||||
|
|
||||||
add_options_conditions_to(@query.first)
|
add_options_conditions_to(@query)
|
||||||
|
|
||||||
@document = Webrat::XML.document(stringlike)
|
@document = Webrat::XML.document(stringlike)
|
||||||
@document.xpath(*@query)
|
@document.xpath(*@query)
|
||||||
@ -88,7 +88,7 @@ module Webrat
|
|||||||
end
|
end
|
||||||
|
|
||||||
def query
|
def query
|
||||||
[@expected].flatten.compact
|
@expected
|
||||||
end
|
end
|
||||||
|
|
||||||
# ==== Returns
|
# ==== Returns
|
||||||
|
Loading…
Reference in New Issue
Block a user