提交 8c879b7a 编写于 作者: K Kasper Timm Hansen

Merge pull request #21787 from ronakjangir47/deprecate_const_defined

Added test case for deprecation of Mime.const_defined? and removed use of it
......@@ -18,7 +18,7 @@ class MimeTypeTest < ActiveSupport::TestCase
assert_equal Mime::Type[:MOBILE], Mime::EXTENSION_LOOKUP['mobile']
Mime::Type.unregister(:mobile)
assert !Mime.const_defined?(:MOBILE), "Mime::MOBILE should not be defined"
assert !Mime::Type.registered?(:MOBILE), "Mime::MOBILE should not be defined"
assert !Mime::LOOKUP.has_key?('text/x-mobile'), "Mime::LOOKUP should not have key ['text/x-mobile]"
assert !Mime::EXTENSION_LOOKUP.has_key?('mobile'), "Mime::EXTENSION_LOOKUP should not have key ['mobile]"
ensure
......@@ -183,6 +183,10 @@ class MimeTypeTest < ActiveSupport::TestCase
end
end
test "deprecated const_defined?" do
assert_deprecated { Mime.const_defined?(:ALL) }
end
test "verifiable mime types" do
all_types = Mime::SET.symbols
all_types.uniq!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册