Don't modify raw namespaces.
When calling Element#available_namespaces the list of namespaces returned by Element#namespaces must not be modified.
This commit is contained in:
parent
a4459c866f
commit
804646cc5e
|
@ -273,7 +273,7 @@ module Oga
|
|||
# @return [Hash]
|
||||
#
|
||||
def available_namespaces
|
||||
merged = namespaces
|
||||
merged = namespaces.dup
|
||||
node = parent
|
||||
|
||||
while node && node.respond_to?(:namespaces)
|
||||
|
|
|
@ -418,6 +418,10 @@ describe Oga::XML::Element do
|
|||
example 'return the "baz" namespace for the parent' do
|
||||
@parent_ns['baz'].uri.should == 'yyy'
|
||||
end
|
||||
|
||||
example 'do not modify the list of direct namespaces' do
|
||||
@child.namespaces.key?('foo').should == false
|
||||
end
|
||||
end
|
||||
|
||||
context '#self_closing?' do
|
||||
|
|
Loading…
Reference in New Issue