diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-08 21:31:05 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-08 21:31:05 +0000 |
commit | 240c9acb5c3ee0b3d538cf9ba12cb27f5e469dca (patch) | |
tree | 7db67f8d858a043da2593e0b0591f44c8050f0e5 /test/psych | |
parent | a2e3de1b3f876dd9b14fa3a6291a202719405382 (diff) | |
download | ruby-240c9acb5c3ee0b3d538cf9ba12cb27f5e469dca.tar.gz |
* 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
Diffstat (limited to 'test/psych')
-rw-r--r-- | test/psych/test_stream.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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| |