diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-29 10:23:55 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-29 10:23:55 -0700 |
commit | 26eee0cd258ef47d595e9ae44e06ccf4d71ced56 (patch) | |
tree | 3632e3d2930c740ae05348c643837e22d41d8e5d /test | |
parent | 75fdcc42bb2ce2abb206f01b8e90729dedc8286c (diff) | |
download | psych-26eee0cd258ef47d595e9ae44e06ccf4d71ced56.zip |
testing implcit document ends
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_emitter.rb | 16 |
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 |