diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/class.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb index 74616e9c8..a6ba336e3 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -235,6 +235,23 @@ assert('class to return the last value') do assert_equal(m, :m) end +assert('raise when superclass is not a class') do + module FirstModule; end + assert_raise(TypeError, 'should raise TypeError') do + class FirstClass < FirstModule; end + end + + class SecondClass; end + assert_raise(TypeError, 'should raise TypeError') do + class SecondClass < false; end + end + + class ThirdClass; end + assert_raise(TypeError, 'should raise TypeError') do + class ThirdClass < ThirdClass; end + end +end + assert('Class#inherited') do class Foo @@subclass_name = nil |
