From 4169440f382eb85b82ea069e0fd3eca1bcb048fb Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 7 Jun 2014 02:41:01 +0000 Subject: * object.c (rb_mod_initialize_clone): Override Kernel#initialize_clone to avoid an exception on Class.new.freeze.clone.to_s. Reported by Andrew Grimm. [ruby-core:41858] [Bug #5828] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_class.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index b40cab8050..963c497d2f 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -378,4 +378,10 @@ class TestClass < Test::Unit::TestCase assert_predicate(self.singleton_class, :singleton_class?, feature7609) assert_not_predicate(self.class, :singleton_class?, feature7609) end + + def test_freeze_to_s + assert_nothing_raised("[ruby-core:41858] [Bug #5828]") { + Class.new.freeze.clone.to_s + } + end end -- cgit v1.2.3