Class | Mocha::ExpectationList |
In: |
lib/mocha/expectation_list.rb
|
Parent: | Object |
# File lib/mocha/expectation_list.rb, line 9 9: def add(expectation) 10: @expectations << expectation 11: expectation 12: end
# File lib/mocha/expectation_list.rb, line 18 18: def detect(method_name, *arguments) 19: expectations = @expectations.reverse.select { |e| e.match?(method_name, *arguments) } 20: expectation = expectations.detect { |e| e.invocations_allowed? } 21: expectation || expectations.first 22: end
# File lib/mocha/expectation_list.rb, line 14 14: def matches_method?(method_name) 15: @expectations.any? { |expectation| expectation.matches_method?(method_name) } 16: end