summaryrefslogtreecommitdiff
path: root/test/ostruct/test_ostruct.rb
diff options
context:
space:
mode:
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