Make sure celerity driver doesn't choke up when no nodes found

This commit is contained in:
Jonas Nicklas 2010-07-10 13:00:34 +02:00
parent 10fd24b62b
commit f74bb11732
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ class Capybara::Driver::Celerity < Capybara::Driver::Base
def find(locator)
noko_node = Nokogiri::HTML(driver.body).xpath(node.xpath).first
all_nodes = noko_node.xpath(locator).map { |n| n.path }.join(' | ')
driver.find(all_nodes)
if all_nodes.empty? then [] else driver.find(all_nodes) end
end
end