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
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/mail-2.7.1/lib/mail/matchers/attachment_matchers.rb