aboutsummaryrefslogtreecommitdiffstats
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.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 963c497d2f..9a4cdb0f58 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -384,4 +384,13 @@ class TestClass < Test::Unit::TestCase
Class.new.freeze.clone.to_s
}
end
+
+ def test_singleton_class_of_frozen_object
+ obj = Object.new
+ c = obj.singleton_class
+ obj.freeze
+ assert_raise(RuntimeError, /frozen object/) {
+ c.class_eval {def f; end}
+ }
+ end
end