class RSpec::Mocks::MethodDouble

def define_proxy_method

def define_proxy_method
  method_name = @method_name
  visibility_for_method = "#{visibility} :#{method_name}"
  object_singleton_class.class_eval(<<-EOF, __FILE__, __LINE__)
    def #{method_name}(*args, &block)
      __mock_proxy.message_received :#{method_name}, *args, &block
    end
    #{visibility_for_method}
  EOF
end