From 240c9acb5c3ee0b3d538cf9ba12cb27f5e469dca Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 8 Mar 2012 21:31:05 +0000 Subject: * ext/psych/lib/psych.rb (load, parse): stop parsing or loading after the first document has been parsed. * test/psych/test_stream.rb: pertinent tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_stream.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/psych/test_stream.rb') diff --git a/test/psych/test_stream.rb b/test/psych/test_stream.rb index 9807207661..beca365608 100644 --- a/test/psych/test_stream.rb +++ b/test/psych/test_stream.rb @@ -2,6 +2,16 @@ require 'psych/helper' module Psych class TestStream < TestCase + def test_parse_partial + rb = Psych.parse("--- foo\n...\n--- `").to_ruby + assert_equal 'foo', rb + end + + def test_load_partial + rb = Psych.load("--- foo\n...\n--- `") + assert_equal 'foo', rb + end + def test_parse_stream_yields_documents list = [] Psych.parse_stream("--- foo\n...\n--- bar") do |doc| -- cgit v1.2.3