Skip to content

Commit

Permalink
Silence warnings for Encoding.default_external= and Encoding.default_…
Browse files Browse the repository at this point in the history
…internal=
  • Loading branch information
spastorino committed Aug 22, 2010
1 parent 7cb44a5 commit 0579963
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
9 changes: 6 additions & 3 deletions actionmailer/test/abstract_unit.rb
Expand Up @@ -11,15 +11,18 @@
$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
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
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'
Expand Down
8 changes: 6 additions & 2 deletions actionpack/test/abstract_unit.rb
Expand Up @@ -12,12 +12,16 @@

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
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
silence_warnings do
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
end
end

require 'test/unit'
Expand Down
9 changes: 6 additions & 3 deletions activesupport/test/abstract_unit.rb
Expand Up @@ -10,16 +10,19 @@
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
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
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' }
Expand Down

0 comments on commit 0579963

Please sign in to comment.