summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-29 10:17:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-29 10:17:15 -0700
commit75fdcc42bb2ce2abb206f01b8e90729dedc8286c (patch)
tree4c69fbc6f75718e6ab701fb8e9d886c36737d586 /test
parentd2bf942ac38b1b6e91116a06855a00d32b95d27b (diff)
downloadpsych-75fdcc42bb2ce2abb206f01b8e90729dedc8286c.zip
mapping tested
Diffstat (limited to 'test')
-rw-r--r--test/visitors/test_emitter.rb15
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