class Shoulda::Matchers::Independent::DelegateMethodMatcher

def formatted_calls_on_delegate_object

def formatted_calls_on_delegate_object
  String.new.tap do |string|
    if calls_on_delegate_object.any?
      string << "\n\n"
      calls_on_delegate_object.each_with_index do |call, i|
        name = call.method_name
        args = call.args.map(&:inspect).join(', ')
        string << "#{i + 1}) #{name}(#{args})\n"
      end
    else
      string << ' (none)'
    end
    string.rstrip!
  end
end