diff options
author | Matthew Draper <matthew@trebex.net> | 2016-12-31 11:47:24 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-12-31 11:47:24 +1030 |
commit | c3ff36815c542fac25b2da4e3cff320499b60998 (patch) | |
tree | d0314f6a18213a0f8e9ff6e51faedf5ab1d24d96 /activesupport | |
parent | ee669ab36fe93b8784416c408e84dee5c49d7427 (diff) | |
parent | c7fc843431ffd2b775cc798d4c2c844fee3c9958 (diff) | |
download | rails-c3ff36815c542fac25b2da4e3cff320499b60998.tar.gz rails-c3ff36815c542fac25b2da4e3cff320499b60998.tar.bz2 rails-c3ff36815c542fac25b2da4e3cff320499b60998.zip |
Merge pull request #12509 from eitoball/pluralize_for_non_ascii_character_words
Fix ActiveSupport::Inflector.pluralize behavior for words that consist of non-ASCII characters
(test only; the original bug was fixed by 1bf50badd943e684a56a03392ef0ddafefca0ad7)
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/inflector_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index d881bd346d..b054e41a79 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -31,6 +31,14 @@ class InflectorTest < ActiveSupport::TestCase assert_equal "", ActiveSupport::Inflector.pluralize("") end + def test_pluralize_for_words_with_non_ascii_characters + ActiveSupport::Inflector.inflections do |inflect| + inflect.uncountable "猫" + end + assert_equal "猫", ActiveSupport::Inflector.pluralize("猫") + ActiveSupport::Inflector.inflections.uncountables.pop + end + ActiveSupport::Inflector.inflections.uncountable.each do |word| define_method "test_uncountability_of_#{word}" do assert_equal word, ActiveSupport::Inflector.singularize(word) |