# File lib/mocha/expectation_list.rb, line 22
22:     def detect(method_name, *arguments)
23:       expectations = @expectations.reverse.select { |e| e.match?(method_name, *arguments) }
24:       expectation = expectations.detect { |e| e.invocations_allowed? }
25:       expectation || expectations.first
26:     end