summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-08 13:33:13 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-08 13:33:13 -0800
commitf506d5e4762b74536a5821392f06ec1c24e89536 (patch)
treec449da921454610a587b0cfa23a89d965b16a210 /test
parent34d3b22d2b94e58b0e51ac922ea48d686fcbb901 (diff)
downloadpsych-f506d5e4762b74536a5821392f06ec1c24e89536.zip
* 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.
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_stream.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/psych/test_stream.rb b/test/psych/test_stream.rb
index 9807207..beca365 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|