diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-07 02:41:01 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-07 02:41:01 +0000 |
commit | 4169440f382eb85b82ea069e0fd3eca1bcb048fb (patch) | |
tree | 16ec9d8ad5a174cc4f779c4b2d3091e92944bd75 /test/ruby/test_class.rb | |
parent | aae187788296ab4f693539479523bcd7168a584a (diff) | |
download | ruby-4169440f382eb85b82ea069e0fd3eca1bcb048fb.tar.gz |
* 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
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r-- | test/ruby/test_class.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |