diff options
Diffstat (limited to 'test/visitors/test_emitter.rb')
-rw-r--r-- | test/visitors/test_emitter.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/visitors/test_emitter.rb b/test/visitors/test_emitter.rb index e2e14aa..b7b9110 100644 --- a/test/visitors/test_emitter.rb +++ b/test/visitors/test_emitter.rb @@ -26,6 +26,7 @@ module Psych @visitor.accept s assert_match(/1.1/, @io.string) + assert_equal @io.string, s.to_yaml end def test_scalar @@ -39,9 +40,23 @@ module Psych @visitor.accept s assert_match(/hello/, @io.string) + assert_equal @io.string, s.to_yaml end def test_sequence + s = Nodes::Stream.new + doc = Nodes::Document.new + scalar = Nodes::Scalar.new 'hello world' + seq = Nodes::Sequence.new + + seq.children << scalar + doc.children << seq + s.children << doc + + @visitor.accept s + + assert_match(/- hello/, @io.string) + assert_equal @io.string, s.to_yaml end end end |