class Mocha::ExpectationList
Public Class Methods
Public Instance Methods
Source
# File lib/mocha/expectation_list.rb, line 9 def add(expectation) @expectations.unshift(expectation) expectation end
Source
# File lib/mocha/expectation_list.rb, line 22 def match(method_name, *arguments) matching_expectations(method_name, *arguments).first end
Source
# File lib/mocha/expectation_list.rb, line 26 def match_allowing_invocation(method_name, *arguments) matching_expectations(method_name, *arguments).detect { |e| e.invocations_allowed? } end
Source
# File lib/mocha/expectation_list.rb, line 18 def matches_method?(method_name) @expectations.any? { |expectation| expectation.matches_method?(method_name) } end
Source
# File lib/mocha/expectation_list.rb, line 14 def remove_all_matching_method(method_name) @expectations.reject! { |expectation| expectation.matches_method?(method_name) } end
Source
# File lib/mocha/expectation_list.rb, line 30 def verified?(assertion_counter = nil) @expectations.all? { |expectation| expectation.verified?(assertion_counter) } end