mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
require XPath 3.2+ and remove no longer necessary patches
This commit is contained in:
parent
288f95c299
commit
d91ec4572a
3 changed files with 1 additions and 32 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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)
|
Loading…
Reference in a new issue