summaryrefslogtreecommitdiffhomepage
path: root/test/t/module.rb
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-07-17 02:01:52 +0900
committerYukihiro Matsumoto <[email protected]>2012-07-17 02:01:52 +0900
commit6696876e729a99a0a54e0989ef38361687fb0b5d (patch)
tree8abf2ee297ce00fb870a322eeab649a893e9dbcd /test/t/module.rb
parent526dd09b7a7bbaaddfe4d73b5d407409d518742d (diff)
downloadmruby-6696876e729a99a0a54e0989ef38361687fb0b5d.tar.gz
mruby-6696876e729a99a0a54e0989ef38361687fb0b5d.zip
refactoring on module tests
Diffstat (limited to 'test/t/module.rb')
-rw-r--r--test/t/module.rb18
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