提交 b52a6ba1 编写于 作者: N Neeraj Singh 提交者: José Valim

clean up test by using unregister method

上级 e8708836
......@@ -201,10 +201,8 @@ def setup
def teardown
super
Mime.module_eval { remove_const :IPHONE if const_defined?(:IPHONE) }
Mime.module_eval { remove_const :MOBILE if const_defined?(:MOBILE) }
Mime::LOOKUP.reject!{|key,_| key == 'text/x-mobile'}
Mime::LOOKUP.reject!{|key,_| key == 'text/iphone'}
Mime::Type.unregister('text/x-mobile', :iphone)
Mime::Type.unregister('text/iphone', :mobile)
end
def test_html
......@@ -617,10 +615,8 @@ def setup
def teardown
super
Mime.module_eval { remove_const :IPHONE if const_defined?(:IPHONE) }
Mime.module_eval { remove_const :MOBILE if const_defined?(:MOBILE) }
Mime::LOOKUP.reject!{|key,_| key == 'text/x-mobile'}
Mime::LOOKUP.reject!{|key,_| key == 'text/iphone'}
Mime::Type.unregister('text/x-mobile', :iphone)
Mime::Type.unregister('text/iphone', :mobile)
end
def test_using_resource
......@@ -1006,10 +1002,8 @@ def setup
def teardown
super
Mime.module_eval { remove_const :IPHONE if const_defined?(:IPHONE) }
Mime.module_eval { remove_const :MOBILE if const_defined?(:MOBILE) }
Mime::LOOKUP.reject!{|key,_| key == 'text/x-mobile'}
Mime::LOOKUP.reject!{|key,_| key == 'text/iphone'}
Mime::Type.unregister('text/x-mobile', :iphone)
Mime::Type.unregister('text/iphone', :mobile)
end
def test_missing_layout_renders_properly
......
......@@ -85,8 +85,7 @@ class MimeTypeTest < ActiveSupport::TestCase
assert_equal Mime::GIF, Mime::SET.last
end
ensure
Mime.module_eval { remove_const :GIF if const_defined?(:GIF) }
Mime::LOOKUP.reject!{|key,_| key == 'image/gif'}
Mime::Type.unregister('image/gif', :gif)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册