diff options
| author | Carson McDonald <[email protected]> | 2013-12-27 18:33:25 -0500 |
|---|---|---|
| committer | Carson McDonald <[email protected]> | 2013-12-27 18:33:25 -0500 |
| commit | 0b8e342d59ed225ca0723a489fb49aa954804752 (patch) | |
| tree | b829dde4e03523ac902dbb3c9ff64d876523e621 /test | |
| parent | 9f212b9e819b25e666125d07583fb27b599cf150 (diff) | |
| download | mruby-0b8e342d59ed225ca0723a489fb49aa954804752.tar.gz mruby-0b8e342d59ed225ca0723a489fb49aa954804752.zip | |
When superclass isn't a class tests
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 |
