diff --git a/spec/oga/xml/node_spec.rb b/spec/oga/xml/node_spec.rb index 4cc196e..2123693 100644 --- a/spec/oga/xml/node_spec.rb +++ b/spec/oga/xml/node_spec.rb @@ -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