class Mocha::StubbedMethod
def define_new_method
def define_new_method self_in_scope = self method_name_in_scope = method_name stub_method_owner.send(:define_method, method_name) do |*args, &block| self_in_scope.mock.handle_method_call(method_name_in_scope, args, block) end stub_method_owner.send(:ruby2_keywords, method_name) retain_original_visibility(stub_method_owner) end