Sha256: 3efb3f3aea259935ed7b3a52c70053b1fbcc7968b4b58d0de81d0bcd50bde7cd

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

module Rad
  module RSpecHelper
    def sent_letters
      Rad::RSpecHelper.sent_letters
    end
    
    class << self
      attr_accessor :sent_letters
    end    
  end  
end

rspec do
  def self.with_mail
    Rad::Mailer.class_eval do
      def deliver letter
        Rad::RSpecHelper.sent_letters << letter
      end
    end
    
    Mail.defaults do
      delivery_method :test
    end
    
    rspec.include Rad::RSpecHelper
    
    before :each do
      Rad::RSpecHelper.sent_letters = []
    end        
  end  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rad_core-0.0.13 lib/rad/spec/mail.rb