mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 15:47:59 -05:00
./devise/test/support/webrat/matchers.rb:6: warning:
Nokogiri::CSS.parse is deprecated and will be removed in a future
version of Nokogiri. Use Nokogiri::CSS::Parser#parse instead.
17 lines
511 B
Ruby
17 lines
511 B
Ruby
# Monkey patch for Nokogiri changes - https://github.com/sparklemotion/nokogiri/issues/2469
|
|
module Webrat
|
|
module Matchers
|
|
class HaveSelector
|
|
def query
|
|
Nokogiri::CSS::Parser.new.parse(@expected.to_s).map do |ast|
|
|
if ::Gem::Version.new(Nokogiri::VERSION) < ::Gem::Version.new('1.17.2')
|
|
ast.to_xpath('//', Nokogiri::CSS::XPathVisitor.new)
|
|
else
|
|
ast.to_xpath(Nokogiri::CSS::XPathVisitor.new)
|
|
end
|
|
end.first
|
|
end
|
|
end
|
|
end
|
|
end
|