提交 c3ff3681 编写于 作者: M Matthew Draper

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 1bf50bad)
......@@ -31,6 +31,14 @@ def test_pluralize_empty_string
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册