diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-17 02:01:52 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-17 02:01:52 +0900 |
| commit | 6696876e729a99a0a54e0989ef38361687fb0b5d (patch) | |
| tree | 8abf2ee297ce00fb870a322eeab649a893e9dbcd /test/t/module.rb | |
| parent | 526dd09b7a7bbaaddfe4d73b5d407409d518742d (diff) | |
| download | mruby-6696876e729a99a0a54e0989ef38361687fb0b5d.tar.gz mruby-6696876e729a99a0a54e0989ef38361687fb0b5d.zip | |
refactoring on module tests
Diffstat (limited to 'test/t/module.rb')
| -rw-r--r-- | test/t/module.rb | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/test/t/module.rb b/test/t/module.rb index 0e5abff81..5b847e8b7 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -14,7 +14,6 @@ end # TODO not implemented ATM assert('Module.nesting', '15.2.2.3.2') do assert('Module#ancestors', '15.2.2.4.9') do - r = String.ancestors r.class == Array and r.include?(String) and r.include?(Object) end @@ -53,21 +52,12 @@ assert('Module.const_missing', '15.2.2.4.22') do e1 = nil module Test4ConstMissing - def const_missing(sym) - # ATM this redirect doesn't work - puts "PLEASE GO TO TEST CASE Module.const_missing!" - puts "IT IS WORKING NOW!! PLEASE FINALIZE." - puts "Thanks :)" + def self.const_missing(sym) + 42 # the answer to everything end end - begin - Test4ConstMissing.const_get(:ConstDoesntExist) - rescue => e2 - e1 = e2 - end - - e1.class == NameError + Test4ConstMissing.const_get(:ConstDoesntExist) == 42 end assert('Module#const_get', '15.2.2.4.23') do @@ -93,7 +83,7 @@ end assert('Module#included', '15.2.2.4.29') do module Test4Included Const4Included = 42 - def Test4Included.included mod + def self.included mod Test4Included.const_set(:Const4Included2, mod) end end |
