Ignore default external warnings

This commit is contained in:
Joshua Peek
2016-09-23 13:48:24 -07:00
parent 2ea1ff2736
commit c525e3fbef
2 changed files with 34 additions and 10 deletions

View File

@@ -3,15 +3,27 @@ require_relative "./helper"
class TestBlob < Minitest::Test
include Linguist
def silence_warnings
original_verbosity = $VERBOSE
$VERBOSE = nil
yield
ensure
$VERBOSE = original_verbosity
end
def setup
# git blobs are normally loaded as ASCII-8BIT since they may contain data
# with arbitrary encoding not known ahead of time
@original_external = Encoding.default_external
Encoding.default_external = Encoding.find("ASCII-8BIT")
silence_warnings do
# git blobs are normally loaded as ASCII-8BIT since they may contain data
# with arbitrary encoding not known ahead of time
@original_external = Encoding.default_external
Encoding.default_external = Encoding.find("ASCII-8BIT")
end
end
def teardown
Encoding.default_external = @original_external
silence_warnings do
Encoding.default_external = @original_external
end
end
def script_blob(name)