From 4b4249fa7efd5862cbda9ff889c9d56ae3338d0a Mon Sep 17 00:00:00 2001 From: Ronak Jangir Date: Sun, 27 Sep 2015 14:10:57 +0530 Subject: Added test case for deprecation of Mime.const_defined? and removed use of it. --- actionpack/test/dispatch/mime_type_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 91f6f66fe3..68083ed747 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -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! -- cgit v1.2.3