diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-29 10:17:15 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-29 10:17:15 -0700 |
commit | 75fdcc42bb2ce2abb206f01b8e90729dedc8286c (patch) | |
tree | 4c69fbc6f75718e6ab701fb8e9d886c36737d586 /test | |
parent | d2bf942ac38b1b6e91116a06855a00d32b95d27b (diff) | |
download | psych-75fdcc42bb2ce2abb206f01b8e90729dedc8286c.zip |
mapping tested
Diffstat (limited to 'test')
-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 b7b9110..cdca130 100644 --- a/test/visitors/test_emitter.rb +++ b/test/visitors/test_emitter.rb @@ -58,6 +58,21 @@ module Psych assert_match(/- hello/, @io.string) assert_equal @io.string, s.to_yaml end + + def test_mapping + 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 + end end end end |