mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
When superclass isn't a class tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user