Skip to content
Browse files

Fix #78.

It appears that Object#__method__ is already a Ruby method. Who knew!
  • Loading branch information...
1 parent 364dc14 commit 5504f5ebe32b8a535e71a01588aa8941e5324263 @floehopper committed Apr 25, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/mocha/class_method.rb
  2. +1 −1 lib/mocha/object.rb
  3. +1 −1 test/unit/object_test.rb
View
2 lib/mocha/class_method.rb
@@ -36,7 +36,7 @@ def reset_mocha
def hide_original_method
if method_exists?(method)
begin
- @original_method = stubbee.__method__(method)
+ @original_method = stubbee._method(method)
if @original_method && @original_method.owner == stubbee.__metaclass__
@original_visibility = :public
if stubbee.__metaclass__.protected_instance_methods.include?(method)
View
2 lib/mocha/object.rb
@@ -13,7 +13,7 @@ module Mocha
module ObjectMethods
# @private
- alias_method :__method__, :method
+ alias_method :_method, :method
# @private
def mocha
View
2 test/unit/object_test.rb
@@ -86,7 +86,7 @@ def test_nobody_expects_the_spanish_inquisition
def test_should_alias_object_method
klass = Class.new { def self.method_x; end }
- assert_equal klass.__method__(:method_x), klass.method(:method_x)
+ assert_equal klass._method(:method_x), klass.method(:method_x)
end
end

0 comments on commit 5504f5e

Please sign in to comment.
Something went wrong with that request. Please try again.