提交 682d247c 编写于 作者: C Carlos Antonio da Silva

Merge pull request #6806 from chancancode/add_test_singularize_of_irregularity

Inflector: Added missing tests cases to ensure idempotency of singularize and pluralize
......@@ -413,6 +413,16 @@ def test_clear_with_default
end
end
Irregularities.each do |irregularity|
singular, plural = *irregularity
ActiveSupport::Inflector.inflections do |inflect|
define_method("test_singularize_of_irregularity_#{singular}_should_be_the_same") do
inflect.irregular(singular, plural)
assert_equal singular, ActiveSupport::Inflector.singularize(singular)
end
end
end
[ :all, [] ].each do |scope|
ActiveSupport::Inflector.inflections do |inflect|
define_method("test_clear_inflections_with_#{scope.kind_of?(Array) ? "no_arguments" : scope}") do
......
......@@ -308,5 +308,7 @@ module InflectorTestCases
'child' => 'children',
'sex' => 'sexes',
'move' => 'moves',
'cow' => 'kine',
'zombie' => 'zombies',
}
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册