Permalink
Browse files

Unregister Mime::Type in teardown.

  • Loading branch information...
zuhao committed May 28, 2014
1 parent b22b188 commit 35cc73e79d352430c140964570a0a6df727d1097
Showing with 6 additions and 2 deletions.
  1. +6 −2 actionpack/test/controller/send_file_test.rb
@@ -32,14 +32,18 @@ class SendFileWithActionControllerLive < SendFileController
class SendFileTest < ActionController::TestCase
include TestFileUtils
- Mime::Type.register "image/png", :png unless defined? Mime::PNG
-
def setup
+ @mime_type_defined = defined? Mime::PNG
+ Mime::Type.register "image/png", :png unless @mime_type_defined
@controller = SendFileController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
+ teardown do
+ Mime::Type.unregister :png unless @mime_type_defined
+ end
+
def test_file_nostream
@controller.options = { :stream => false }
response = nil

0 comments on commit 35cc73e

Please sign in to comment.