diff options
author | kennyj <kennyj@gmail.com> | 2011-12-09 01:27:58 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2011-12-09 01:42:34 +0900 |
commit | d4d2e8eb2e744e8a46f20a794b8923820fbacbe5 (patch) | |
tree | 1d03e10329556906cef4a41e8244806235e0e4bc /railties/test/application | |
parent | 199353c658007727a428949ac11663175fb2c531 (diff) | |
download | rails-d4d2e8eb2e744e8a46f20a794b8923820fbacbe5.tar.gz rails-d4d2e8eb2e744e8a46f20a794b8923820fbacbe5.tar.bz2 rails-d4d2e8eb2e744e8a46f20a794b8923820fbacbe5.zip |
Fix testcase an error on ruby 1.8.x.
In Ruby 1.8.x, config.encoding sets $KCODE.
Therefore, the possible values are UTF8, SJIS, or EUC.
And, if we set SJIS, we'll has the error. Because some rails sources are written in utf-8 encoding.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index e6e2c525f5..cf6c4d8fc2 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -137,9 +137,10 @@ module ApplicationTests end test "assignment config.encoding to default_charset" do - add_to_config "config.encoding = 'Shift_JIS'" + charset = "ruby".respond_to?(:force_encoding) ? 'Shift_JIS' : 'UTF8' + add_to_config "config.encoding = '#{charset}'" require "#{app_path}/config/environment" - assert_equal 'Shift_JIS', ActionDispatch::Response.default_charset + assert_equal charset, ActionDispatch::Response.default_charset end # AS |