From 4bb1f865fcfb5f6dda9fde30646e7a246f36361c Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 23 Oct 2009 23:37:14 +0000 Subject: * class.c (rb_class_new): move class check to rb_check_inheritable(). * class.c (rb_check_inheritable): should not allow subclass of class Class. [ruby-core:26225] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_class.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index 8fe127231..a1f087ad6 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -170,8 +170,7 @@ class TestClass < Test::Unit::TestCase o = Object.new c = class << o; self; end assert_raise(TypeError) { Class.new(c) } - - assert_nothing_raised { Class.new(Class) } # is it OK? + assert_raise(TypeError) { Class.new(Class) } assert_raise(TypeError) { eval("class Foo < Class; end") } end -- cgit