summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-11-25 06:31:42 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2012-11-25 06:31:42 -0800
commitd03bd87dc0213954f1f15c24507b38d1820192eb (patch)
treefc0e193f6f0ee56cc9e5d0a9853a41346e39ac63 /test
parent32bacb21a2d51e9466b54bc5e30a832e68077c78 (diff)
parent25a02a5b8b7954fa197d42d208ee257a4a8d9c96 (diff)
downloadmruby-d03bd87dc0213954f1f15c24507b38d1820192eb.tar.gz
mruby-d03bd87dc0213954f1f15c24507b38d1820192eb.zip
Merge pull request #571 from skandhas/pr-add-Module-include-p
add "Module#include?" for mruby
Diffstat (limited to 'test')
-rw-r--r--test/t/module.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/t/module.rb b/test/t/module.rb
index 511658150..96bded1ee 100644
--- a/test/t/module.rb
+++ b/test/t/module.rb
@@ -92,6 +92,20 @@ assert('Module#include', '15.2.2.4.27') do
Test4Include2.const_get(:Const4Include) == 42
end
+assert('Module#include?', '15.2.2.4.28') do
+ module Test4IncludeP
+ end
+ class Test4IncludeP2
+ include Test4IncludeP
+ end
+ class Test4IncludeP3 < Test4IncludeP2
+ end
+
+ Test4IncludeP2.include?(Test4IncludeP) &&
+ Test4IncludeP3.include?(Test4IncludeP) &&
+ ! Test4IncludeP.include?(Test4IncludeP)
+end
+
assert('Module#included', '15.2.2.4.29') do
module Test4Included
Const4Included = 42