aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_class.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-07 02:41:01 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-07 02:41:01 +0000
commit4169440f382eb85b82ea069e0fd3eca1bcb048fb (patch)
tree16ec9d8ad5a174cc4f779c4b2d3091e92944bd75 /test/ruby/test_class.rb
parentaae187788296ab4f693539479523bcd7168a584a (diff)
downloadruby-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.rb6
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