Skip to content

Commit

Permalink
Move encoding settings for testing purposes to abstract_unit file
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Aug 22, 2010
1 parent b4e5da6 commit 11e9883
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 5 additions & 1 deletion actionpack/test/abstract_unit.rb
Expand Up @@ -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'
Expand Down
9 changes: 1 addition & 8 deletions actionpack/test/template/template_test.rb
@@ -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

Expand Down Expand Up @@ -136,4 +129,4 @@ def with_external_encoding(encoding)
Encoding.default_external = old
end
end
end
end

0 comments on commit 11e9883

Please sign in to comment.