1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add transfer_encoding= setter deprecation.

This commit is contained in:
José Valim 2010-01-30 16:39:27 +01:00
parent 0e063f435c
commit 2d567e470a
2 changed files with 17 additions and 1 deletions

View file

@ -18,6 +18,12 @@ module Mail
end
end
def transfer_encoding=(value)
ActiveSupport::Deprecation.warn('Message#transfer_encoding= is deprecated, please call ' <<
'Message#content_transfer_encoding= with the same arguments', caller[0,2])
self.content_transfer_encoding = value
end
def original_filename
ActiveSupport::Deprecation.warn('Message#original_filename is deprecated, ' <<
'please call Message#filename', caller[0,2])

View file

@ -22,4 +22,14 @@ class TmailCompatTest < ActiveSupport::TestCase
assert_equal mail.content_transfer_encoding, "base64"
end
def test_transfer_encoding_setter_raises_deprecation_warning
mail = Mail.new
assert_deprecated do
assert_nothing_raised do
mail.transfer_encoding = "base64"
end
end
assert_equal mail.content_transfer_encoding, "base64"
end
end