aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-21 11:21:43 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-21 11:21:43 +0000
commitc95002c284add2da69845f2a9407c5dd6592cb62 (patch)
tree49e2ae91459e7dfcc091e4113fdf38c3a04096dd /activesupport/test
parent909b2c1acf2eb18b7a75a8cb8af0154fc948fb01 (diff)
downloadrails-c95002c284add2da69845f2a9407c5dd6592cb62.tar.gz
rails-c95002c284add2da69845f2a9407c5dd6592cb62.tar.bz2
rails-c95002c284add2da69845f2a9407c5dd6592cb62.zip
Multibyte: String#chars returns self for Ruby 1.9
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/multibyte_chars_test.rb13
-rw-r--r--activesupport/test/multibyte_conformance.rb6
-rw-r--r--activesupport/test/multibyte_handler_test.rb6
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