summaryrefslogtreecommitdiff
path: root/test/visitors/test_emitter.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-29 09:53:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-29 09:53:42 -0700
commitd2bf942ac38b1b6e91116a06855a00d32b95d27b (patch)
tree0ecec2c190f7288929e0dbcfe2cc37547d5859cb /test/visitors/test_emitter.rb
parenta23403e809e8ddcb6b6cccf8f0169606cd376331 (diff)
downloadpsych-d2bf942ac38b1b6e91116a06855a00d32b95d27b.zip
sequences emit
Diffstat (limited to 'test/visitors/test_emitter.rb')
-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 e2e14aa..b7b9110 100644
--- a/test/visitors/test_emitter.rb
+++ b/test/visitors/test_emitter.rb
@@ -26,6 +26,7 @@ module Psych
@visitor.accept s
assert_match(/1.1/, @io.string)
+ assert_equal @io.string, s.to_yaml
end
def test_scalar
@@ -39,9 +40,23 @@ module Psych
@visitor.accept s
assert_match(/hello/, @io.string)
+ assert_equal @io.string, s.to_yaml
end
def test_sequence
+ s = Nodes::Stream.new
+ doc = Nodes::Document.new
+ scalar = Nodes::Scalar.new 'hello world'
+ seq = Nodes::Sequence.new
+
+ seq.children << scalar
+ doc.children << seq
+ s.children << doc
+
+ @visitor.accept s
+
+ assert_match(/- hello/, @io.string)
+ assert_equal @io.string, s.to_yaml
end
end
end