Sha256: 07c875267205e9e519e8340d73b99a67010f283fc4407c6e757a6ec2202a2f56

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

##############################################################################
#                               Email Plugin
##############################################################################
#
# The approach to this plugin is twofold. First it uses the excellent email_spec
# gem to add helpers and matchers to any spec file with :email => true set.
# Secondly, it will also clear all deliveries from ActionMailer if it is loaded.
#
# https://github.com/bmabey/email-spec/
#
begin
  require 'email_spec'

  RSpec.configure do |config|
    config.include EmailSpec::Helpers,          :email => true
    config.include EmailSpec::Matchers,         :email => true
    config.include EmailSpec::MailerDeliveries, :email => true
  end
rescue LoadError
end

if defined? ActionMailer
  RSpec.configure do |config|
    config.before(:each, :email => true) do
      if defined?(ActionMailer) && ActionMailer::Base.delivery_method == :cache
        mailer.clear_cache
      else
        deliveries.clear
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rspeckled-0.0.16 lib/rspeckled/plugins/email.rb
rspeckled-0.0.15 lib/rspeckled/plugins/email.rb
rspeckled-0.0.14 lib/rspeckled/plugins/email.rb
rspeckled-0.0.13 lib/rspeckled/plugins/email.rb
rspeckled-0.0.12 lib/rspeckled/plugins/email.rb
rspeckled-0.0.11 lib/rspeckled/plugins/email.rb
rspeckled-0.0.10 lib/rspeckled/plugins/email.rb
rspeckled-0.0.9 lib/rspeckled/plugins/email.rb
rspeckled-0.0.8 lib/rspeckled/plugins/email.rb
rspeckled-0.0.7 lib/rspeckled/plugins/email.rb
rspeckled-0.0.6 lib/rspeckled/plugins/email.rb
rspeckled-0.0.5 lib/rspeckled/plugins/email.rb
rspeckled-0.0.4 lib/rspeckled/plugins/email.rb
rspeckled-0.0.3 lib/rspeckled/plugins/email.rb