Tests for Node#children=.

This commit is contained in:
Yorick Peterse 2014-07-01 10:09:42 +02:00
parent 75e96ee779
commit 4b408eae4f
1 changed files with 20 additions and 0 deletions

View File

@ -15,4 +15,24 @@ describe Oga::XML::Node do
described_class.new.node_type.should == :node
end
end
context '#children=' do
example 'set the child nodes using an Array' do
child = described_class.new
node = described_class.new
node.children = [child]
node.children[0].should == child
end
example 'set the child nodes using a NodeSet' do
child = described_class.new
node = described_class.new
node.children = Oga::XML::NodeSet.new([child])
node.children[0].should == child
end
end
end