summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index e9529273eb..0a11be46e3 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -440,6 +440,10 @@ class TestModule < Test::Unit::TestCase
EOS
end
+ def test_include_with_no_args
+ assert_raise(ArgumentError) { Module.new { include } }
+ end
+
def test_included_modules
assert_equal([], Mixin.included_modules)
assert_equal([Mixin], User.included_modules)
@@ -1868,6 +1872,10 @@ class TestModule < Test::Unit::TestCase
end;
end
+ def test_prepend_module_with_no_args
+ assert_raise(ArgumentError) { Module.new { prepend } }
+ end
+
def test_class_variables
m = Module.new
m.class_variable_set(:@@foo, 1)
@@ -1934,6 +1942,10 @@ class TestModule < Test::Unit::TestCase
assert_equal(['public', 'protected'], list)
end
+ def test_extend_module_with_no_args
+ assert_raise(ArgumentError) { Module.new { extend } }
+ end
+
def test_invalid_attr
%W[
foo?