Fixes #127
This commit is contained in:
parent
0977be81bb
commit
496811a23f
|
@ -1691,7 +1691,9 @@ module Oga
|
|||
def name_matches?(xml_node, name)
|
||||
return false unless xml_node.respond_to?(:name)
|
||||
|
||||
name == STAR ? true : xml_node.name == name
|
||||
return true if name == STAR
|
||||
|
||||
xml_node.name == name || xml_node.name.downcase == name.downcase
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
@ -92,6 +92,12 @@ describe Oga::XPath::Evaluator do
|
|||
|
||||
@evaluator.node_matches?(text, s(:test, nil, 'a')).should == false
|
||||
end
|
||||
|
||||
it 'returns true if a node is matched case insensitively' do
|
||||
node = Oga::XML::Element.new(:name => 'DiV')
|
||||
|
||||
@evaluator.node_matches?(node, s(:test, nil, 'div')).should == true
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with a custom namespace' do
|
||||
|
|
Loading…
Reference in New Issue