Permalink
Browse files

Move encoding settings for testing purposes to abstract_unit file

  • Loading branch information...
1 parent b4e5da6 commit 11e9883f19f1812832650de1d5c57c5cc7b2c2d5 @spastorino spastorino committed Aug 22, 2010
Showing with 6 additions and 9 deletions.
  1. +5 −1 actionpack/test/abstract_unit.rb
  2. +1 −8 actionpack/test/template/template_test.rb
@@ -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

0 comments on commit 11e9883

Please sign in to comment.