diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-10-06 17:10:46 -0400 |
---|---|---|
committer | Marc-Andre Lafortune <github@marc-andre.ca> | 2020-10-06 17:11:08 -0400 |
commit | 1486785a5759c5cb0b7a7bf0bc5368cc9a280191 (patch) | |
tree | c19e72f0df77dd3eb14cf9ad17937fd0a7fcc288 /test/ostruct/test_ostruct.rb | |
parent | 260322fbc58a225d1c0323d53698ff62a31cf552 (diff) |
[lib/ostruct] Fix Marshal loading
Diffstat (limited to 'test/ostruct/test_ostruct.rb')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 1e69d79dfd..9d151c3a2f 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -333,4 +333,10 @@ class TC_OpenStruct < Test::Unit::TestCase assert_equal true, os1.eql?(os2) assert_equal 300.42, os2.pension end + + def test_marshal + o = OpenStruct.new(name: "John Smith", age: 70, pension: 300.42) + o2 = Marshal.load(Marshal.dump(o)) + assert_equal o, o2 + end end |