1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add a test for [ruby-dev:31709].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-09-02 06:39:58 +00:00
parent e8959acc9f
commit 96c859834e

View file

@ -36,4 +36,12 @@ class TestMarshal < Test::Unit::TestCase
def test_marshal_cloned_class
assert_instance_of(StrClone, Marshal.load(Marshal.dump(StrClone.new("abc"))))
end
def test_inconsistent_struct
TestMarshal.const_set :S, Struct.new(:a)
s = Marshal.dump(S.new(1))
TestMarshal.instance_eval { remove_const :S }
TestMarshal.const_set :S, Class.new
assert_raise(TypeError, "[ruby-dev:31709]") { Marshal.load(s) }
end
end