diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-25 04:55:07 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-01-25 04:55:07 -0800 |
| commit | b69bb896fcae64373606172fc43c558f02d4207f (patch) | |
| tree | 3240f552ea496ffc3a32f5e7635fbb37691ba526 /test/t | |
| parent | e0e5aebc66833dfe55b362678032f7e0e4a265d7 (diff) | |
| parent | 25045345c9ae9f456b27c9fbc63caee6372e16d4 (diff) | |
| download | mruby-b69bb896fcae64373606172fc43c558f02d4207f.tar.gz mruby-b69bb896fcae64373606172fc43c558f02d4207f.zip | |
Merge pull request #1664 from h2so5/clone-class-module
clone Class/Module rightly
Diffstat (limited to 'test/t')
| -rw-r--r-- | test/t/class.rb | 10 | ||||
| -rw-r--r-- | test/t/module.rb | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/t/class.rb b/test/t/class.rb index a6ba336e3..bea20ee24 100644 --- a/test/t/class.rb +++ b/test/t/class.rb @@ -359,3 +359,13 @@ assert('singleton tests') do end end end + +assert('clone Class') do + class Foo + def func + true + end + end + + Foo.clone.new.func +end diff --git a/test/t/module.rb b/test/t/module.rb index 170eb925a..48a09f720 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -503,3 +503,17 @@ assert('Issue 1467') do C1.new C2.new end + +assert('clone Module') do + module M1 + def foo + true + end + end + + class B + include M1.clone + end + + B.new.foo +end |
