diff --git a/spec/oga/xml/document_spec.rb b/spec/oga/xml/document_spec.rb index 0a3607a..9dba917 100644 --- a/spec/oga/xml/document_spec.rb +++ b/spec/oga/xml/document_spec.rb @@ -8,8 +8,10 @@ describe Oga::XML::Document do document.children[0].should == child end + end - example 'set the child nodes via a setter' do + context '#children=' do + example 'set the child nodes using an Array' do child = Oga::XML::Comment.new(:text => 'foo') document = described_class.new @@ -17,6 +19,15 @@ describe Oga::XML::Document do document.children[0].should == child end + + example 'set the child nodes using a NodeSet' do + child = Oga::XML::Comment.new(:text => 'foo') + document = described_class.new + + document.children = Oga::XML::NodeSet.new([child]) + + document.children[0].should == child + end end context '#to_xml' do