Permalink
Browse files

Move encoding settings for testing purposes to abstract_unit file

  • Loading branch information...
1 parent 7a090b0 commit 1d888d465b27e6257ebd3af9b4e73e9f49a45de1 @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 1d888d4

Please sign in to comment.