summaryrefslogtreecommitdiff
path: root/test/ruby/marshaltestlib.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-08 15:26:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-08 15:26:08 +0000
commit0316cf2e523d9f77e610477697d5a93842b4d4bd (patch)
tree57833bca5dea888008e464c2be185f93b0280055 /test/ruby/marshaltestlib.rb
parente14095fff2aed4599a69d8c53ee5ca017a6e8826 (diff)
marshal.c: prepended objects
* marshal.c (r_object0): load prepended objects. treat the class of extended object in the included modules as prepended singleton class. [ruby-core:53202] [Bug #8041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/marshaltestlib.rb')
-rw-r--r--test/ruby/marshaltestlib.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/marshaltestlib.rb b/test/ruby/marshaltestlib.rb
index f14209fc19..45c94e0f15 100644
--- a/test/ruby/marshaltestlib.rb
+++ b/test/ruby/marshaltestlib.rb
@@ -75,6 +75,16 @@ module MarshalTestLib
marshal_equal_with_ancestry(o1)
end
+ def test_object_prepend
+ bug8041 = '[ruby-core:53202] [Bug #8041]'
+
+ o1 = MyObject.new(42)
+ o1.singleton_class.class_eval {prepend Mod1}
+ assert_nothing_raised(ArgumentError, bug8041) {
+ marshal_equal_with_ancestry(o1, bug8041)
+ }
+ end
+
class MyArray < Array
def initialize(v, *args)
super(args)