summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorBeoran <[email protected]>2012-10-09 21:45:41 +0200
committerBeoran <[email protected]>2012-10-09 21:45:41 +0200
commit8949e3c7fb964e58d1666e9dba20c575e553b479 (patch)
treeed077661499d65848891b3f6581933837695472b /test
parentcf2bd3469a08ac20cffa62fe00c54fd69844fcfa (diff)
downloadmruby-8949e3c7fb964e58d1666e9dba20c575e553b479.tar.gz
mruby-8949e3c7fb964e58d1666e9dba20c575e553b479.zip
Bugfix for crash if main was extended with a module.
Diffstat (limited to 'test')
-rw-r--r--test/t/kernel.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb
index fb0aee310..5caa3d7ac 100644
--- a/test/t/kernel.rb
+++ b/test/t/kernel.rb
@@ -204,6 +204,16 @@ assert('Kernel#extend', '15.3.1.3.13') do
a.respond_to?(:test_method) == true && b.respond_to?(:test_method) == false
end
+assert('Kernel#extend works on toplevel', '15.3.1.3.13') do
+ module Test4ExtendModule
+ def test_method; end
+ end
+ # This would crash...
+ extend(Test4ExtendModule)
+
+ respond_to?(:test_method) == true
+end
+
assert('Kernel#global_variables', '15.3.1.3.14') do
global_variables.class == Array
end