class RSpec::Rails::Matchers::SendEmail

def matched_email?(email)

def matched_email?(email)
  @criteria.all? do |attr, value|
    expected =
      case attr
      when :to, :from, :cc, :bcc then Array(value)
      else
        value
      end
    values_match?(expected, email.public_send(attr))
  end
end