Sha256: e0956c16c0004e14faec9f844de6927584fc07ffe3d6302e8abce95ceffd48f1
Contents?: true
Size: 900 Bytes
Versions: 14
Compression:
Stored size: 900 Bytes
Contents
# frozen_string_literal: true module Mail module Matchers def any_attachment AnyAttachmentMatcher.new end def an_attachment_with_filename(filename) AttachmentFilenameMatcher.new(filename) end def an_attachment_with_mime_type(filename) AttachmentMimeTypeMatcher.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 class AttachmentMimeTypeMatcher attr_reader :mime_type def initialize(mime_type) @mime_type = mime_type end def ===(other) other.attachment? && other.mime_type == mime_type end end end end
Version data entries
14 entries across 14 versions & 5 rubygems