Skip to content
Browse files

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.
  • Loading branch information...
1 parent 199353c commit d4d2e8eb2e744e8a46f20a794b8923820fbacbe5 @kennyj committed Dec 9, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 railties/test/application/initializers/frameworks_test.rb
5 railties/test/application/initializers/frameworks_test.rb
@@ -137,9 +137,10 @@ def from_bar_helper
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
# AS

0 comments on commit d4d2e8e

Please sign in to comment.
Something went wrong with that request. Please try again.