diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index bc5ee62..82e735d 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -32,6 +32,24 @@ class TestMarshal < Test::Unit::TestCase return f end + class MM + attr_reader :calls + + def initialize + @calls = [] + end + + def method_missing name, *args + @calls << [name, args] + end + end + + def test_mm + mm = MM.new + assert_instance_of(MM, Marshal.load(Marshal.dump(mm))) + assert mm.calls.empty? + end + def test_marshal a = [1, 2, 3, [4,5,"foo"], {1=>"bar"}, 2.5, fact(30)] assert_equal a, Marshal.load(Marshal.dump(a))