diff options
| author | Masamitsu MURASE <[email protected]> | 2012-07-17 00:56:18 +0900 |
|---|---|---|
| committer | Masamitsu MURASE <[email protected]> | 2012-07-17 00:56:18 +0900 |
| commit | 8020c280aa88354d797bdaf754c7beeb42dabab4 (patch) | |
| tree | 26c13f31ad6d4b533923844b18add0aa2b844681 | |
| parent | ba08a2b9dddf97c84a73ab72f708e2bfef2d6b82 (diff) | |
| download | mruby-8020c280aa88354d797bdaf754c7beeb42dabab4.tar.gz mruby-8020c280aa88354d797bdaf754c7beeb42dabab4.zip | |
Add test for Kernel#extend.
| -rw-r--r-- | test/t/kernel.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb index 5aa7672d7..4f1d2b42f 100644 --- a/test/t/kernel.rb +++ b/test/t/kernel.rb @@ -187,6 +187,21 @@ assert('Kernel#dup', '15.3.1.3.9') do c.respond_to?(:test) == false end +assert('Kernel#extend', '15.3.1.3.13') do + class Test4ExtendClass + end + + module Test4ExtendModule + def test_method; end + end + + a = Test4ExtendClass.new + a.extend(Test4ExtendModule) + b = Test4ExtendClass.new + + a.respond_to?(:test_method) == true && b.respond_to?(:test_method) == false +end + assert('Kernel#global_variables', '15.3.1.3.14') do global_variables.class == Array end |
