Sha256: 3fd99de72fa5e9cf28aca0c16b625be5dd417c065aac54d91b5013abb8b59cce

Contents?: true

Size: 561 Bytes

Versions: 72

Compression:

Stored size: 561 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

    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

Version data entries

72 entries across 56 versions & 13 rubygems

Version Path
tdiary-5.0.9 vendor/bundle/gems/mail-2.7.0/lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/mail-2.7.0/lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/mail-2.7.0/lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.8 vendor/bundle/gems/mail-2.7.0/lib/mail/matchers/attachment_matchers.rb
mail-2.7.1.rc1 lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.7 vendor/bundle/gems/mail-2.7.0/lib/mail/matchers/attachment_matchers.rb
mail-2.7.0 lib/mail/matchers/attachment_matchers.rb
mail-2.7.0.rc3 lib/mail/matchers/attachment_matchers.rb
mail-2.7.0.rc2 lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.6 vendor/bundle/gems/mail-2.6.6/lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.5 vendor/bundle/gems/mail-2.6.6/lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.5 vendor/bundle/gems/mail-2.6.4/lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mail-2.6.4/lib/mail/matchers/attachment_matchers.rb
mail-2.6.6 lib/mail/matchers/attachment_matchers.rb
mail-2.7.0.rc1 lib/mail/matchers/attachment_matchers.rb
mail-2.6.6.rc1 lib/mail/matchers/attachment_matchers.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/mail-2.6.5/lib/mail/matchers/attachment_matchers.rb
mail-2.6.5 lib/mail/matchers/attachment_matchers.rb
mail-2.6.5.rc1 lib/mail/matchers/attachment_matchers.rb
tdiary-5.0.4 vendor/bundle/gems/mail-2.6.4/lib/mail/matchers/attachment_matchers.rb