test/action_mailer.rb in ar_mailer-1.1.0 vs test/action_mailer.rb in ar_mailer-1.2.0
- old
+ new
@@ -1,6 +1,7 @@
require 'net/smtp'
+require 'smtp_tls'
require 'time'
class Net::SMTP
@reset_called = 0
@@ -13,11 +14,11 @@
attr_reader :deliveries
attr_reader :send_message_block
attr_accessor :reset_called
- alias old_start start
+ send :remove_method, :start
end
def self.start(*args)
yield new(nil)
@@ -31,17 +32,17 @@
deliveries.clear
on_send_message
@reset_called = 0
end
- alias old_reset reset if instance_methods.include? 'reset'
+ alias test_old_reset reset if instance_methods.include? 'reset'
def reset
self.class.reset_called += 1
end
- alias old_send_message send_message
+ alias test_old_send_message send_message
def send_message(mail, to, from)
return self.class.send_message_block.call(mail, to, from) unless
self.class.send_message_block.nil?
self.class.deliveries << [mail, to, from]
@@ -92,11 +93,11 @@
##
# Stub for an ActiveRecord model
class Email
- START = Time.parse 'Thu Aug 10 11:19:48'
+ START = Time.parse 'Thu Aug 10 2006 11:19:48'
attr_accessor :from, :to, :mail, :last_send_attempt, :created_on, :id
@records = []
@id = 0
@@ -142,9 +143,11 @@
def save
end
end
+
+Mail = Email
class String
def classify
self
end