diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/multibyte_chars_test.rb | 13 | ||||
-rw-r--r-- | activesupport/test/multibyte_conformance.rb | 6 | ||||
-rw-r--r-- | activesupport/test/multibyte_handler_test.rb | 6 |
3 files changed, 22 insertions, 3 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index e8493f4708..4afb63b949 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -1,6 +1,15 @@ require 'abstract_unit' -$KCODE = 'UTF8' if RUBY_VERSION < '1.9' +if RUBY_VERSION >= '1.9' + class CharsTest < Test::Unit::TestCase + def test_chars_returns_self + str = 'abc' + assert_equal str.object_id, str.chars.object_id + end + end +else + +$KCODE = 'UTF8' class CharsTest < Test::Unit::TestCase @@ -175,3 +184,5 @@ class CharsTest < Test::Unit::TestCase end end end + +end diff --git a/activesupport/test/multibyte_conformance.rb b/activesupport/test/multibyte_conformance.rb index fdcfda383f..05fb9ef7a7 100644 --- a/activesupport/test/multibyte_conformance.rb +++ b/activesupport/test/multibyte_conformance.rb @@ -1,7 +1,9 @@ require 'abstract_unit' require 'open-uri' -$KCODE = 'UTF8' if RUBY_VERSION < '1.9' +if RUBY_VERSION < '1.9' + +$KCODE = 'UTF8' UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::UNICODE_VERSION}/ucd" UNIDATA_FILE = '/NormalizationTest.txt' @@ -140,3 +142,5 @@ class ConformanceTestPure < Test::Unit::TestCase @handler = ::ActiveSupport::Multibyte::Handlers::UTF8Handler end end + +end diff --git a/activesupport/test/multibyte_handler_test.rb b/activesupport/test/multibyte_handler_test.rb index f61176886b..a52392b8bd 100644 --- a/activesupport/test/multibyte_handler_test.rb +++ b/activesupport/test/multibyte_handler_test.rb @@ -1,6 +1,8 @@ require 'abstract_unit' -$KCODE = 'UTF8' if RUBY_VERSION < '1.9' +if RUBY_VERSION < '1.9' + +$KCODE = 'UTF8' class String # Unicode Inspect returns the codepoints of the string in hex @@ -365,3 +367,5 @@ class UTF8HandlingTestPure < Test::Unit::TestCase @handler = ::ActiveSupport::Multibyte::Handlers::UTF8Handler end end + +end |