diff --git a/capybara.gemspec b/capybara.gemspec index f10cae0d..01977e0a 100644 --- a/capybara.gemspec +++ b/capybara.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency('nokogiri', ['~> 1.8']) s.add_runtime_dependency('rack', ['>= 1.6.0']) s.add_runtime_dependency('rack-test', ['>= 0.6.3']) - s.add_runtime_dependency('xpath', ['~>3.1']) + s.add_runtime_dependency('xpath', ['~>3.2']) s.add_development_dependency('cucumber', ['>= 2.3.0']) s.add_development_dependency('erubi') # dependency specification needed by rbx diff --git a/lib/capybara.rb b/lib/capybara.rb index f187cde9..323b883e 100644 --- a/lib/capybara.rb +++ b/lib/capybara.rb @@ -414,7 +414,6 @@ module Capybara module RackTest; end module Selenium; end - require 'capybara/xpath_patches' require 'capybara/helpers' require 'capybara/session' require 'capybara/window' diff --git a/lib/capybara/xpath_patches.rb b/lib/capybara/xpath_patches.rb deleted file mode 100644 index a9ba22ed..00000000 --- a/lib/capybara/xpath_patches.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -module XPath - module DSL - UPPERCASE_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ' - LOWERCASE_LETTERS = 'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ' - - def lowercase - method(:translate, UPPERCASE_LETTERS, LOWERCASE_LETTERS) - end - - def uppercase - method(:translate, LOWERCASE_LETTERS, UPPERCASE_LETTERS) - end - end -end - -module Capybara - module XPathPatches - module Renderer - def attribute(current, name) - return super if name =~ /^[a-zA-Z_:][a-zA-Z0-9_:\.\-]*$/ - - "#{current}/attribute::*[local-name(.) = #{string_literal(name)}]" - end - end - end -end - -XPath::Renderer.prepend(Capybara::XPathPatches::Renderer)