File: //usr/local/rvm/gems/ruby-3.0.2/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
# frozen_string_literal: true
module Mail
module Matchers
def any_attachment
AnyAttachmentMatcher.new
end
def an_attachment_with_filename(filename)
AttachmentFilenameMatcher.new(filename)
end
class AnyAttachmentMatcher
def ===(other)
other.attachment?
end
end
class AttachmentFilenameMatcher
attr_reader :filename
def initialize(filename)
@filename = filename
end
def ===(other)
other.attachment? && other.filename == filename
end
end
end
end