aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_chars_test.rb
diff options
context:
space:
mode:
authorJason Cheow <jfh7crw02@sneakemail.com>2008-11-26 22:16:28 +0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-12-08 16:02:57 -0800
commit4e60eebae05aeec65e4894e3901c9d61c9b32910 (patch)
tree45cc75a790161a76c55da6db97a69cea56f95c42 /activesupport/test/multibyte_chars_test.rb
parent9b22e56d89a55460a18d5f38adf9fee919f52266 (diff)
downloadrails-4e60eebae05aeec65e4894e3901c9d61c9b32910.tar.gz
rails-4e60eebae05aeec65e4894e3901c9d61c9b32910.tar.bz2
rails-4e60eebae05aeec65e4894e3901c9d61c9b32910.zip
Add ActiveSupport::Multibyte::Chars#ord method so that it returns correct Unicode value instead of falling back on String#ord in CoreExtensions, which is not multibyte compatible
[#1483 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/test/multibyte_chars_test.rb')
-rw-r--r--activesupport/test/multibyte_chars_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb
index ca2af9b986..067c461837 100644
--- a/activesupport/test/multibyte_chars_test.rb
+++ b/activesupport/test/multibyte_chars_test.rb
@@ -397,6 +397,10 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
assert_raise(ArgumentError) { @chars.slice(1, 1, 1) }
end
+ def test_ord_should_return_unicode_value_for_first_character
+ assert_equal 12371, @chars.ord
+ end
+
def test_upcase_should_upcase_ascii_characters
assert_equal '', ''.mb_chars.upcase
assert_equal 'ABC', 'aBc'.mb_chars.upcase