Move encoding settings for testing purposes to abstract_unit file
This commit is contained in:
parent
7a090b0216
commit
1d888d465b
@ -12,8 +12,12 @@
|
||||
|
||||
ENV['TMPDIR'] = File.join(File.dirname(__FILE__), 'tmp')
|
||||
|
||||
if defined?(Encoding.default_internal)
|
||||
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"
|
||||
end
|
||||
|
||||
require 'test/unit'
|
||||
|
@ -1,12 +1,5 @@
|
||||
require "abstract_unit"
|
||||
|
||||
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"
|
||||
end
|
||||
|
||||
class TestERBTemplate < ActiveSupport::TestCase
|
||||
ERBHandler = ActionView::Template::Handlers::ERB
|
||||
|
||||
@ -136,4 +129,4 @@ def with_external_encoding(encoding)
|
||||
Encoding.default_external = old
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user