summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOrenGitHub <[email protected]>2025-04-29 06:14:37 +0300
committergit <[email protected]>2025-05-09 17:53:17 +0000
commitae299cc9cd7e19626c973f166098a4128c2779ed (patch)
tree4f899f2a59cc9d07dbf7d84e80ff6bbebd9f5edb /test
parentf0e2a41d4bacd4ad37843b662194f128737407cf (diff)
[ruby/psych] add first test for safe load stream
https://github.com/ruby/psych/commit/336553b412
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_stream.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/psych/test_stream.rb b/test/psych/test_stream.rb
index 9b71c6d996..ae940d1ee4 100644
--- a/test/psych/test_stream.rb
+++ b/test/psych/test_stream.rb
@@ -54,6 +54,14 @@ module Psych
assert_equal %w{ foo bar }, list
end
+ def test_safe_load_stream_yields_documents
+ list = []
+ Psych.safe_load_stream("--- foo\n...\n--- bar") do |ruby|
+ list << ruby
+ end
+ assert_equal %w{ foo bar }, list
+ end
+
def test_load_stream_break
list = []
Psych.load_stream("--- foo\n...\n--- `") do |ruby|