diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-02-15 12:56:27 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-02-15 12:56:27 +0900 |
| commit | 3f9450e7b07bea475dc0ceccda55c216a4a8a2c2 (patch) | |
| tree | dbfe0f37ca1ed7e94c3a15aba5dbaf17e1c0da63 /test/t | |
| parent | 1e5b5b14d7468ca4fedaa9ba1c9dba0ff67d7ea8 (diff) | |
| download | mruby-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')
| -rw-r--r-- | test/t/nomethoderror.rb | 20 |
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 |
