1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Partly picked from 20d0b8c065

This commit is contained in:
Hiroshi SHIBATA 2021-07-29 15:52:32 +09:00
parent 1e04571da0
commit b3413914d9
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -375,7 +375,7 @@ class TC_OpenStruct < Test::Unit::TestCase
o = OpenStruct.new(table: {foo: 42})
assert_equal({foo: 42}, YAML.safe_load(YAML.dump(o), permitted_classes: [Symbol, OpenStruct]).table)
end
end if RUBY_VERSION >= '2.6'
def test_yaml
h = {name: "John Smith", age: 70, pension: 300.42}
@ -386,7 +386,7 @@ class TC_OpenStruct < Test::Unit::TestCase
assert_equal os1, os2
assert_equal true, os1.eql?(os2)
assert_equal 300.42, os2.pension
end
end if RUBY_VERSION >= '2.6'
def test_marshal
o = OpenStruct.new(name: "John Smith", age: 70, pension: 300.42)