diff options
author | Manfred Stienstra <manfred@fngtps.com> | 2008-09-21 17:22:26 +0200 |
---|---|---|
committer | Manfred Stienstra <manfred@fngtps.com> | 2008-09-21 17:22:26 +0200 |
commit | 042fd971271791659c90e065e761cf90d3117b74 (patch) | |
tree | 995334b047b9328fc77abe54bda73ec6135d35d2 /activesupport/test | |
parent | 22f75d539dca7b6f33cbf86e4e9d1944bb22731f (diff) | |
download | rails-042fd971271791659c90e065e761cf90d3117b74.tar.gz rails-042fd971271791659c90e065e761cf90d3117b74.tar.bz2 rails-042fd971271791659c90e065e761cf90d3117b74.zip |
Add a test for ActiveSupport::Multibyte::Chars.consumes?.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/multibyte_chars_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index 31b8f1b760..5029d2e051 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -29,7 +29,8 @@ class MultibyteCharsTest < Test::Unit::TestCase include MultibyteTest def setup - @chars = ActiveSupport::Multibyte::Chars.new UNICODE_STRING + @proxy_class = ActiveSupport::Multibyte::Chars + @chars = @proxy_class.new UNICODE_STRING end def test_wraps_the_original_string @@ -70,6 +71,12 @@ class MultibyteCharsTest < Test::Unit::TestCase assert_equal 'ab', 'a'.mb_chars << 'b'.mb_chars end + def test_consumes_utf8_strings + assert @proxy_class.consumes?(UNICODE_STRING) + assert @proxy_class.consumes?(ASCII_STRING) + assert !@proxy_class.consumes?(BYTE_STRING) + end + if RUBY_VERSION < '1.9' def test_concatenation_should_return_a_proxy_class_instance assert_equal ActiveSupport::Multibyte.proxy_class, ('a'.mb_chars + 'b').class |