diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-28 12:09:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-28 12:09:59 -0700 |
commit | 1d0463ca1f63f84032b5b983962e59f88ff123a0 (patch) | |
tree | 376518e957f132601c3df11cff8db91cc4ecd993 /test | |
parent | 9f5da8f6aa0bfc3d59817de9d5c8a22000c0b9ce (diff) | |
download | psych-1d0463ca1f63f84032b5b983962e59f88ff123a0.zip |
streams convert to ruby
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_to_ruby.rb | 14 |
1 files changed, 14 insertions, 0 deletions
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 |