class Mail::TestMailer
if you want to make a custom mailer for Mail
It also provides a template of the minimum methods you require to implement
when you are testing.
The TestMailer is a bare bones mailer that does nothing. It is useful
def self.deliveries
def self.deliveries @@deliveries ||= [] end
def self.deliveries=(val)
* size
* length
* clear
* << (message)
If you place another object here, please make sure it responds to:
call TestMailer.deliveries.clear.
other object. If you just want to clear the store,
Allows you to over write the default deliveries store from an array to some
def self.deliveries=(val) @@deliveries = val end
def deliver!(mail)
def deliver!(mail) # Create the envelope to validate it Mail::SmtpEnvelope.new(mail) Mail::TestMailer.deliveries << mail end
def initialize(values)
def initialize(values) @settings = values.dup end