summaryrefslogtreecommitdiffhomepage
path: root/test/t/nomethoderror.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-02-15 12:56:27 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-02-15 12:56:27 +0900
commit3f9450e7b07bea475dc0ceccda55c216a4a8a2c2 (patch)
treedbfe0f37ca1ed7e94c3a15aba5dbaf17e1c0da63 /test/t/nomethoderror.rb
parent1e5b5b14d7468ca4fedaa9ba1c9dba0ff67d7ea8 (diff)
downloadmruby-3f9450e7b07bea475dc0ceccda55c216a4a8a2c2.tar.gz
mruby-3f9450e7b07bea475dc0ceccda55c216a4a8a2c2.zip
Move BasicObject#method_missing to Kernel#method_missing; ref #3417
More compatibility to CRuby. Updated tests that assume old mruby behavior.
Diffstat (limited to 'test/t/nomethoderror.rb')
-rw-r--r--test/t/nomethoderror.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/t/nomethoderror.rb b/test/t/nomethoderror.rb
index 41a3ba14f..35cbdaee9 100644
--- a/test/t/nomethoderror.rb
+++ b/test/t/nomethoderror.rb
@@ -21,20 +21,20 @@ assert('NoMethodError#args', '15.2.32.2.1') do
end
end
-assert('Can still raise when BasicObject#method_missing is removed') do
+assert('Can still raise when Kernel#method_missing is removed') do
assert_raise(NoMethodError) do
begin
- BasicObject.alias_method(:old_method_missing, :method_missing)
- BasicObject.remove_method(:method_missing)
+ Kernel.alias_method(:old_method_missing, :method_missing)
+ Kernel.remove_method(:method_missing)
1.__send__(:foo)
ensure
- BasicObject.alias_method(:method_missing, :old_method_missing)
- BasicObject.remove_method(:old_method_missing)
+ Kernel.alias_method(:method_missing, :old_method_missing)
+ Kernel.remove_method(:old_method_missing)
end
end
end
-assert('Can still call super when BasicObject#method_missing is removed') do
+assert('Can still call super when Kernel#method_missing is removed') do
assert_raise(NoMethodError) do
class A
def foo
@@ -42,12 +42,12 @@ assert('Can still call super when BasicObject#method_missing is removed') do
end
end
begin
- BasicObject.alias_method(:old_method_missing, :method_missing)
- BasicObject.remove_method(:method_missing)
+ Kernel.alias_method(:old_method_missing, :method_missing)
+ Kernel.remove_method(:method_missing)
A.new.foo
ensure
- BasicObject.alias_method(:method_missing, :old_method_missing)
- BasicObject.remove_method(:old_method_missing)
+ Kernel.alias_method(:method_missing, :old_method_missing)
+ Kernel.remove_method(:old_method_missing)
end
end
end