Sha256: 9a4916d047f8cc761cd8c164f91f44040ca90b100c69cf9e4e21cadbb4bf0ab6

Contents?: true

Size: 865 Bytes

Versions: 2

Compression:

Stored size: 865 Bytes

Contents

module FastMailer
  # Original mockup from ActionMailer
  class MockSMTP
  
    def self.deliveries
      @@deliveries
    end

    def initialize(*args)
      @@deliveries ||= []
    end

    def sendmail(mail, from, to)
      @@deliveries << [mail, from, to]
    end

    def start(*args)
      yield self
    end
  
    def self.clear_deliveries
      @@deliveries = []
    end
  
    # in the standard lib: net/smtp.rb line 577
    #   a TypeError is thrown unless this arg is a
    #   kind of OpenSSL::SSL::SSLContext
    def enable_tls(context = nil)
      if context && context.kind_of?(OpenSSL::SSL::SSLContext)
        true
      elsif context
        raise TypeError,
          "wrong argument (#{context.class})! "+
          "(Expected kind of OpenSSL::SSL::SSLContext)"
      end
    end

    def enable_starttls_auto
      true
    end
  
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fast-mailer-0.2.0 lib/fast-mailer/mock_smtp.rb
fast-mailer-0.1.0 lib/fast-mailer/mock_smtp.rb