def invocation_count_error(spy_verification, matching_recorded_calls)
RR::Errors.build_error(RR::Errors::SpyVerificationErrors::InvocationCountError,
"On subject #{spy_verification.subject.inspect}\n" <<
"Expected #{Double.formatted_name(spy_verification.method_name, spy_verification.argument_expectation.expected_arguments)}\n" <<
"to be called #{spy_verification.times_matcher.expected_times_message},\n" <<
"but was called #{matching_recorded_calls.size} times.\n" <<
"All of the method calls related to Doubles are:\n" <<
"\t#{recorded_calls.map {|call| call.inspect}.join("\n\t")}"
)
end