diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-01-28 23:14:22 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-01-28 23:14:22 +0900 |
| commit | c02c4047f8d9449839a6f013a854597cc803bed0 (patch) | |
| tree | da359578a20b9612f3edde4334323f6634e89674 /test/t/class.rb | |
| parent | 1b597f9da45aecfc4d02752629d93de1325d86a4 (diff) | |
| parent | abbc50143364dd84111573e594d24f6ace256eeb (diff) | |
| download | mruby-c02c4047f8d9449839a6f013a854597cc803bed0.tar.gz mruby-c02c4047f8d9449839a6f013a854597cc803bed0.zip | |
Merge pull request #4252 from shuujii/class-expr-with-empty-body-should-return-nil
`class`/`module` expression with empty body should return `nil`
Diffstat (limited to 'test/t/class.rb')
| -rw-r--r-- | test/t/class.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb index f37a891a4..6a0a3225c 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -236,6 +236,11 @@ assert('class to return the last value') do assert_equal(m, :m) end +assert('class to return nil if body is empty') do + assert_nil(class C end) + assert_nil(class << self; end) +end + assert('raise when superclass is not a class') do module FirstModule; end assert_raise(TypeError, 'should raise TypeError') do |
