194: def method_missing(symbol, *arguments, &block)
195: if @responder and not @responder.respond_to?(symbol)
196: raise NoMethodError, "undefined method `#{symbol}' for #{self.mocha_inspect} which responds like #{@responder.mocha_inspect}"
197: end
198: if matching_expectation_allowing_invocation = @expectations.match_allowing_invocation(symbol, *arguments)
199: matching_expectation_allowing_invocation.invoke(&block)
200: else
201: if (matching_expectation = @expectations.match(symbol, *arguments)) || (!matching_expectation && !@everything_stubbed)
202: matching_expectation.invoke(&block) if matching_expectation
203: message = UnexpectedInvocation.new(self, symbol, *arguments).to_s
204: message << @mockery.mocha_inspect
205: raise ExpectationError.new(message, caller)
206: end
207: end
208: end