From 1d0463ca1f63f84032b5b983962e59f88ff123a0 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 28 Sep 2009 12:09:59 -0700 Subject: streams convert to ruby --- test/visitors/test_to_ruby.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/visitors/test_to_ruby.rb b/test/visitors/test_to_ruby.rb index c295caf..c7caf47 100644 --- a/test/visitors/test_to_ruby.rb +++ b/test/visitors/test_to_ruby.rb @@ -34,6 +34,20 @@ module Psych doc.children << Nodes::Scalar.new('foo') assert_equal 'foo', doc.to_ruby end + + def test_stream + a = Nodes::Document.new + a.children << Nodes::Scalar.new('foo') + + b = Nodes::Document.new + b.children << Nodes::Scalar.new('bar') + + stream = Nodes::Stream.new + stream.children << a + stream.children << b + + assert_equal %w{ foo bar }, stream.to_ruby + end end end end -- cgit v1.2.3