define_expected_method(sym) private

No documentation

This method has no description. You can help the RSpec community by adding new notes.

Hide source
# File lib/spec/mocks/proxy.rb, line 130
      def define_expected_method(sym)
        visibility_string = "#{visibility(sym)} :#{sym}"
        unless @proxied_methods.include?(sym)
          if target_responds_to?(sym)
            munged_sym = munge(sym)
            target_metaclass.instance_eval do
              alias_method munged_sym, sym if method_defined?(sym)
            end
            @proxied_methods << sym
          end
        end

        target_metaclass.class_eval("def \#{sym}(*args, &block)\n__mock_proxy.message_received :\#{sym}, *args, &block\nend\n\#{visibility_string}\n", __FILE__, __LINE__)
      end
Register or log in to add new notes.