Skip to content

Commit

Permalink
Unregister Mime::Type in teardown.
Browse files Browse the repository at this point in the history
  • Loading branch information
zuhao committed May 28, 2014
1 parent b22b188 commit 35cc73e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions actionpack/test/controller/send_file_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 35cc73e

Please sign in to comment.