spec/niceogiri/xml/node_spec.rb in niceogiri-0.1.0 vs spec/niceogiri/xml/node_spec.rb in niceogiri-0.1.1
- old
+ new
@@ -143,9 +143,15 @@
n = Nokogiri::XML.parse('<message><bar:foo xmlns:bar="http://bar.com"></message>').root
n2 = Node.new('message').inherit n
n2.to_s.should == n.to_s
end
+ it 'holds on to namespaces when inheriting attributes' do
+ n = Nokogiri::XML.parse('<foo xml:bar="http://bar.com"/>').root
+ n2 = Node.new('foo').inherit n
+ n2.to_s.should == n.to_s
+ end
+
it 'provides a mechanism to inherit attrs' do
n = Node.new 'foo'
n2 = Node.new 'foo'
n2['foo'] = 'bar'