Merge commit 'mikel/master'
This commit is contained in:
commit
97204fc0bc
@ -45,3 +45,5 @@ module Text
|
||||
|
||||
autoload :Format, 'action_mailer/vendor/text_format'
|
||||
end
|
||||
|
||||
require 'action_mailer/tmail_compat'
|
10
actionmailer/lib/action_mailer/tmail_compat.rb
Normal file
10
actionmailer/lib/action_mailer/tmail_compat.rb
Normal file
@ -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
|
14
actionmailer/test/tmail_compat_test.rb
Normal file
14
actionmailer/test/tmail_compat_test.rb
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user