summaryrefslogtreecommitdiff
path: root/test/ruby/test_class.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r--test/ruby/test_class.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index a3384fa083..e3047ccd5f 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -270,4 +270,19 @@ class TestClass < Test::Unit::TestCase
bug5274 = StrClone.new("[ruby-dev:44460]")
assert_equal(bug5274, Marshal.load(Marshal.dump(bug5274)))
end
+
+ def test_cannot_reinitialize_class_with_initialize_copy # [ruby-core:50869]
+ assert_in_out_err([], <<-RUBY, ["Object"], [])
+ class Class
+ def initialize_copy(*); super; end
+ end
+
+ class A; end
+ class B; end
+
+ A.send(:initialize_copy, Class.new(B)) rescue nil
+
+ p A.superclass
+ RUBY
+ end
end