summaryrefslogtreecommitdiff
path: root/test/visitors/test_emitter.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-29 10:23:55 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-29 10:23:55 -0700
commit26eee0cd258ef47d595e9ae44e06ccf4d71ced56 (patch)
tree3632e3d2930c740ae05348c643837e22d41d8e5d /test/visitors/test_emitter.rb
parent75fdcc42bb2ce2abb206f01b8e90729dedc8286c (diff)
downloadpsych-26eee0cd258ef47d595e9ae44e06ccf4d71ced56.zip
testing implcit document ends
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