summaryrefslogtreecommitdiff
path: root/test/ostruct/test_ostruct.rb
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-10-06 17:10:46 -0400
committerMarc-Andre Lafortune <github@marc-andre.ca>2020-10-06 17:11:08 -0400
commit1486785a5759c5cb0b7a7bf0bc5368cc9a280191 (patch)
treec19e72f0df77dd3eb14cf9ad17937fd0a7fcc288 /test/ostruct/test_ostruct.rb
parent260322fbc58a225d1c0323d53698ff62a31cf552 (diff)
[lib/ostruct] Fix Marshal loading
Diffstat (limited to 'test/ostruct/test_ostruct.rb')
-rw-r--r--test/ostruct/test_ostruct.rb6
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