Permalink
Browse files

Added use of AS::Notifications for tmail_compat.rb

  • Loading branch information...
1 parent 12c001f commit 77986f6bdb18414d730fa1ec686365dff26bb4fe @mikel mikel committed Jan 22, 2010
Showing with 6 additions and 5 deletions.
  1. +6 −3 actionmailer/lib/action_mailer/tmail_compat.rb
  2. +0 −2 actionmailer/test/tmail_compat_test.rb
@@ -2,22 +2,25 @@ module Mail
class Message
def set_content_type(*args)
- STDERR.puts("Message#set_content_type is deprecated, please just call Message#content_type with the same arguments.\n#{caller}")
+ ActiveSupport::Deprecation.warn('Message#set_content_type is deprecated, please just call ' <<
+ 'Message#content_type with the same arguments.', caller[0,10])
content_type(*args)
end
alias :old_transfer_encoding :transfer_encoding
def transfer_encoding(value = nil)
if value
- STDERR.puts("Message#transfer_encoding is deprecated, please call Message#content_transfer_encoding with the same arguments.\n#{caller}")
+ ActiveSupport::Deprecation.warn('Message#transfer_encoding is deprecated, please call ' <<
+ 'Message#content_transfer_encoding with the same arguments.', caller[0,10])
content_transfer_encoding(value)
else
old_transfer_encoding
end
end
def original_filename
- STDERR.puts("Message#original_filename is deprecated, please call Message#filename.\n#{caller}")
+ ActiveSupport::Deprecation.warn('Message#original_filename is deprecated, ' <<
+ 'please call Message#filename.', caller[0,10])
filename
end
@@ -4,7 +4,6 @@ class TmailCompatTest < Test::Unit::TestCase
def test_set_content_type_raises_deprecation_warning
mail = Mail.new
- STDERR.expects(:puts) # Deprecation warning
assert_nothing_raised do
mail.set_content_type "text/plain"
end
@@ -13,7 +12,6 @@ def test_set_content_type_raises_deprecation_warning
def test_transfer_encoding_raises_deprecation_warning
mail = Mail.new
- STDERR.expects(:puts) # Deprecation warning
assert_nothing_raised do
mail.transfer_encoding "base64"
end

0 comments on commit 77986f6

Please sign in to comment.