1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Silence warnings for Encoding.default_external= and Encoding.default_internal=

This commit is contained in:
Santiago Pastorino 2010-08-22 18:43:31 -03:00
parent ae2c60734a
commit 8d1ee434da
3 changed files with 18 additions and 8 deletions

View file

@ -11,15 +11,18 @@ ensure
$VERBOSE = old
end
require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/string/encoding'
if "ruby".encoding_aware?
# These are the normal settings that will be set up by Railties
# TODO: Have these tests support other combinations of these values
silence_warnings do
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
end
end
require 'active_support/core_ext/kernel/reporting'
silence_warnings do
# These external dependencies have warnings :/
require 'text/format'

View file

@ -12,12 +12,16 @@ $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
ENV['TMPDIR'] = File.join(File.dirname(__FILE__), 'tmp')
require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/string/encoding'
if "ruby".encoding_aware?
# These are the normal settings that will be set up by Railties
# TODO: Have these tests support other combinations of these values
silence_warnings do
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
end
end
require 'test/unit'

View file

@ -10,16 +10,19 @@ end
lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/string/encoding'
if "ruby".encoding_aware?
# These are the normal settings that will be set up by Railties
# TODO: Have these tests support other combinations of these values
silence_warnings do
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
end
end
require 'test/unit'
require 'active_support/core_ext/kernel/reporting'
require 'empty_bool'
silence_warnings { require 'mocha' }