summaryrefslogtreecommitdiffhomepage
path: root/test/t/class.rb
diff options
context:
space:
mode:
authorcremno <[email protected]>2015-05-29 14:51:48 +0200
committercremno <[email protected]>2015-05-29 14:58:53 +0200
commit59ea323976557408ba1c5f694213c7a31bbb6e39 (patch)
tree5e0b5c7cc137dce12940ab1877847efb3c788dca /test/t/class.rb
parentb05d736b49a6d3a99b7f75c74ffd9b6613c453d3 (diff)
downloadmruby-59ea323976557408ba1c5f694213c7a31bbb6e39.tar.gz
mruby-59ea323976557408ba1c5f694213c7a31bbb6e39.zip
check if outer is a class or module
For modules this check didn't exist yet. Also call #inspect.
Diffstat (limited to 'test/t/class.rb')
-rw-r--r--test/t/class.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb
index d4ecf99d0..720fd37fa 100644
--- a/test/t/class.rb
+++ b/test/t/class.rb
@@ -383,3 +383,8 @@ assert('class variable and class << self style class method') do
assert_equal("value", ClassVariableTest.class_variable)
end
+
+assert('class with non-class/module outer raises TypeError') do
+ assert_raise(TypeError) { class 0::C1; end }
+ assert_raise(TypeError) { class []::C2; end }
+end