aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-08-21 22:36:51 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-08-21 22:37:53 -0300
commit1d888d465b27e6257ebd3af9b4e73e9f49a45de1 (patch)
treeb4dc5a078e8d6e624cce3eb9b48c8b3a8dbae677 /actionpack/test
parent7a090b02165603cc6c18b3153539b4bce96ba065 (diff)
downloadrails-1d888d465b27e6257ebd3af9b4e73e9f49a45de1.tar.gz
rails-1d888d465b27e6257ebd3af9b4e73e9f49a45de1.tar.bz2
rails-1d888d465b27e6257ebd3af9b4e73e9f49a45de1.zip
Move encoding settings for testing purposes to abstract_unit file
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/abstract_unit.rb6
-rw-r--r--actionpack/test/template/template_test.rb9
2 files changed, 6 insertions, 9 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index fb6961d4a3..23b6330805 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -12,8 +12,12 @@ $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
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'
diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb
index 18e0e83ec3..fbc9350c69 100644
--- a/actionpack/test/template/template_test.rb
+++ b/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
@@ -136,4 +129,4 @@ class TestERBTemplate < ActiveSupport::TestCase
Encoding.default_external = old
end
end
-end \ No newline at end of file
+end