Tests for Node#children=.
This commit is contained in:
parent
75e96ee779
commit
4b408eae4f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue