Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge commit 'mikel/master'

  • Loading branch information...
commit 97204fc0bc52af8fb6714e6f9fcd414567e0fc1a 2 parents 8734f9a + 345e622
@jeremy jeremy authored
View
2  actionmailer/lib/action_mailer.rb
@@ -45,3 +45,5 @@ module Text
autoload :Format, 'action_mailer/vendor/text_format'
end
+
+require 'action_mailer/tmail_compat'
View
10 actionmailer/lib/action_mailer/tmail_compat.rb
@@ -0,0 +1,10 @@
+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}")
+ content_type(*args)
+ end
+
+ end
+end
View
14 actionmailer/test/tmail_compat_test.rb
@@ -0,0 +1,14 @@
+require 'abstract_unit'
+
+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
+ assert_equal mail.content_type.string, "text/plain"
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.