Project

tape

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This rubygem does not have a description or summary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Tape

A rewrite of email_spec that borrows a lot but gets rid of bloat. Currently ships with the following adapters:

  • ActionMailer (:test, :active_record, :maildir)
  • Pony

Implementing your own adapter is easy. See below.

It does NOT handle Delayed::Job implicitly. Trigger your workers before checking for mail.

Compatibility

For convenience, email_spec helpers and matchers are available in the Tape::EmailSpec module. Use them if you want to migrate an existing project from email_spec to tape.

Example

require 'tape'

# This will set up your adapter
Tape.configure 'action_mailer/test'

# Get all mails
Tape.adapter.all

# Get last mail
Tape.adapter.last

# Clear mails
Tape.adapter.reset

Implementing an adapter

Adapters inherit from Tape::Adapters::Base and implement only three self-explanatory methods:

  • all
  • last
  • reset