aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_chars_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/multibyte_chars_test.rb')
-rw-r--r--activesupport/test/multibyte_chars_test.rb9
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