diff options
Diffstat (limited to 'test/visitors')
-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 e79a7b5..f440678 100644 --- a/test/visitors/test_emitter.rb +++ b/test/visitors/test_emitter.rb @@ -59,6 +59,21 @@ module Psych assert_equal @io.string, s.to_yaml end + def test_scalar_with_tag + s = Nodes::Stream.new + doc = Nodes::Document.new + scalar = Nodes::Scalar.new 'hello world', nil, '!str', false, false, 5 + + doc.children << scalar + s.children << doc + + @visitor.accept s + + assert_match(/str/, @io.string) + assert_match(/hello/, @io.string) + assert_equal @io.string, s.to_yaml + end + def test_sequence s = Nodes::Stream.new doc = Nodes::Document.new |