From e32a208b7f452584ebf83fbd27fd69ab77b21d69 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 23 Feb 2009 22:18:41 -0500 Subject: [PATCH] Fix warning caused by Nokogiri deprecating CSS::Parser.parse (Aaron Patterson) [#176 state:resolved] --- History.txt | 2 ++ lib/webrat/core/matchers/have_selector.rb | 2 +- lib/webrat/selenium/matchers/have_tag.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/History.txt b/History.txt index 55de196..84f61f0 100644 --- a/History.txt +++ b/History.txt @@ -6,6 +6,8 @@ * Bug fixes + * Fix warning caused by Nokogiri deprecating CSS::Parser.parse + (Aaron Patterson) * Accept do/end blocks in matchers. [#157] (Peter Jaros) * Quote --chdir option to mongrel_rails to support RAILS_ROOTs with spaces (T.J. VanSlyke) diff --git a/lib/webrat/core/matchers/have_selector.rb b/lib/webrat/core/matchers/have_selector.rb index 9b38ead..d79c8ad 100644 --- a/lib/webrat/core/matchers/have_selector.rb +++ b/lib/webrat/core/matchers/have_selector.rb @@ -36,7 +36,7 @@ module Webrat end def query - Nokogiri::CSS::Parser.parse(@expected.to_s).map do |ast| + Nokogiri::CSS.parse(@expected.to_s).map do |ast| ast.to_xpath end.first end diff --git a/lib/webrat/selenium/matchers/have_tag.rb b/lib/webrat/selenium/matchers/have_tag.rb index a7c87ee..c95bc7b 100644 --- a/lib/webrat/selenium/matchers/have_tag.rb +++ b/lib/webrat/selenium/matchers/have_tag.rb @@ -43,7 +43,7 @@ module Webrat selector << "[#{key}='#{value}']" end - Nokogiri::CSS::Parser.parse(selector).map { |ast| ast.to_xpath } + Nokogiri::CSS.parse(selector).map { |ast| ast.to_xpath } end end