Test for Document#children= with a NodeSet.
This commit is contained in:
parent
4e2b7f529d
commit
75e96ee779
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue