From 0f129ceac9d6c4b7ded8537bdafed880fc445488 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Thu, 3 Apr 2014 09:38:18 +0200 Subject: [PATCH] Tests for XML::TreeBuilder#on_comment. --- spec/oga/xml/tree_builder_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/oga/xml/tree_builder_spec.rb b/spec/oga/xml/tree_builder_spec.rb index 11b5c05..d4eafa8 100644 --- a/spec/oga/xml/tree_builder_spec.rb +++ b/spec/oga/xml/tree_builder_spec.rb @@ -47,6 +47,21 @@ describe Oga::XML::TreeBuilder do 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 'simple elements' do before do