зеркало из https://github.com/github/ruby.git
Partly picked from 20d0b8c065
This commit is contained in:
Родитель
1e04571da0
Коммит
b3413914d9
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче