diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-28 23:33:54 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-05-28 23:33:54 +0000 |
commit | 428d1f67dab05b84330c7fc66bff0202aee91bd8 (patch) | |
tree | a5f38dbd990030e29d6891d7a3b23fc37275e705 /activesupport/test | |
parent | d8b67f7fe1ff281a7ba00bd187fe938a12bb5566 (diff) | |
download | rails-428d1f67dab05b84330c7fc66bff0202aee91bd8.tar.gz rails-428d1f67dab05b84330c7fc66bff0202aee91bd8.tar.bz2 rails-428d1f67dab05b84330c7fc66bff0202aee91bd8.zip |
Multibyte strings respond_to the String methods they proxy so they can be duck-typed. Closes #6549.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/multibyte_chars_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index 63aff6eb99..d8766af3b8 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -151,6 +151,13 @@ class CharsTest < Test::Unit::TestCase end end + def test_duck_typing + assert_equal true, 'test'.chars.respond_to?(:strip) + assert_equal true, 'test'.chars.respond_to?(:normalize) + assert_equal true, 'test'.chars.respond_to?(:normalize!) + assert_equal false, 'test'.chars.respond_to?(:a_method_that_doesnt_exist) + end + protected def with_kcode(kcode) |