We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dbf9e36 + 0f40f56 commit 405fae0Copy full SHA for 405fae0
2 files changed
lib/psych/visitors/yaml_tree.rb
@@ -198,7 +198,7 @@ def visit_Data o
198
199
@emitter.end_mapping
200
end
201
- end
+ end unless RUBY_VERSION < "3.2"
202
203
def visit_Struct o
204
tag = ['!ruby/struct', o.class.name].compact.join(':')
test/psych/test_stringio.rb
@@ -0,0 +1,14 @@
1
+# frozen_string_literal: true
2
+require_relative 'helper'
3
+
4
+module Psych
5
+ class TestStringIO < TestCase
6
+ # The superclass of StringIO before Ruby 3.0 was `Data`,
7
+ # which can interfere with the Ruby 3.2+ `Data` dumping.
8
+ def test_stringio
9
+ assert_nothing_raised do
10
+ Psych.dump(StringIO.new("foo"))
11
+ end
12
13
14
+end
0 commit comments