class Spec::Mocks::Proxy

def define_expected_method(sym)

def define_expected_method(sym)
  visibility_string = "#{visibility(sym)} :#{sym}"
  if target_responds_to?(sym) && !target_metaclass.method_defined?(munge(sym))
    munged_sym = munge(sym)
    target_metaclass.instance_eval do
      alias_method munged_sym, sym if method_defined?(sym.to_s)
    end
    @proxied_methods << sym
  end
  
  target_metaclass.class_eval(<<-EOF, __FILE__, __LINE__)
    def #{sym}(*args, &block)
      __mock_proxy.message_received :#{sym}, *args, &block
    end
    #{visibility_string}
  EOF
end