提交 2d567e47 编写于 作者: J José Valim

Add transfer_encoding= setter deprecation.

上级 0e063f43
......@@ -17,7 +17,13 @@ def transfer_encoding(value = nil)
old_transfer_encoding
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])
......
......@@ -21,5 +21,15 @@ def test_transfer_encoding_raises_deprecation_warning
end
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册