Tests for XML::TreeBuilder#on_comment.

This commit is contained in:
Yorick Peterse 2014-04-03 09:38:18 +02:00
parent bdb76cefc5
commit 0f129ceac9
1 changed files with 15 additions and 0 deletions

View File

@ -47,6 +47,21 @@ describe Oga::XML::TreeBuilder do
end end
end end
context '#on_comment' do
before do
node = s(:comment, 'foo')
@tag = @builder.process(node)
end
example 'return a Comment node' do
@tag.is_a?(Oga::XML::Comment).should == true
end
example 'include the text of the comment' do
@tag.text.should == 'foo'
end
end
context '#on_element' do context '#on_element' do
context 'simple elements' do context 'simple elements' do
before do before do