Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unregister Mime::Type in teardown.

  • Loading branch information...
commit 35cc73e79d352430c140964570a0a6df727d1097 1 parent b22b188
@zuhao zuhao authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 actionpack/test/controller/send_file_test.rb
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.