8000 GitHub - adscott/mailcrate: A mock SMTP server loosely based on mailtrap and greenmail
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

adscott/mailcrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mailcrate

by Adam Scott http://adams.co.tt/

Description

A mock SMTP server loosely based on mailtrap and greenmail, and can be used for automated testing. Like mailtrap, mailcrate listens on a chosen port and talks just enough SMTP protocol for ActionMailer to successfully deliver a message. However, like greenmail, it is started, stopped and interogated from your test code.

Install

gem install mailcrate

Usage

The constructor requires a single parameter, the port which it should listen on.

require 'mailcrate'

mailcrate = Mailcrate.new(2525)
mailcrate.start

Mailer.send_mail(:to => 'to@example.com', :from => 'from@example.com', :body => 'An important message.')

mailcrate.mails[0][:from].should == 'from@example.com'
mailcrate.mails[0][:to_list].should include 'to@example.com'
mailcrate.mails[0][:body].should == 'An important message.'

mailcrate.stop

Status

Build Status

About

A mock SMTP server loosely based on mailtrap and greenmail

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0