summaryrefslogtreecommitdiff
path: root/test/visitors/test_emitter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/visitors/test_emitter.rb')
-rw-r--r--test/visitors/test_emitter.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/visitors/test_emitter.rb b/test/visitors/test_emitter.rb
index cdca130..6f19df9 100644
--- a/test/visitors/test_emitter.rb
+++ b/test/visitors/test_emitter.rb
@@ -29,6 +29,22 @@ module Psych
assert_equal @io.string, s.to_yaml
end
+ def test_document_implicit_end
+ s = Nodes::Stream.new
+ doc = Nodes::Document.new
+ mapping = Nodes::Mapping.new
+ mapping.children << Nodes::Scalar.new('key')
+ mapping.children << Nodes::Scalar.new('value')
+ doc.children << mapping
+ s.children << doc
+
+ @visitor.accept s
+
+ assert_match(/key: value/, @io.string)
+ assert_equal @io.string, s.to_yaml
+ assert(/\.\.\./ !~ s.to_yaml)
+ end
+
def test_scalar
s = Nodes::Stream.new
doc = Nodes::Document.new