aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-05-28 22:53:42 +0930
committerMatthew Draper <matthew@trebex.net>2017-05-28 22:54:54 +0930
commit352865d0f835c24daa9a2e9863dcc9dde9e5371a (patch)
tree32e5e2638a38369c100ac80916bb09072e79bfd7 /activesupport/test
parent58a5aa40ec869839fc514116fb81a135050082f6 (diff)
parent7c45146b15e682de11251180eaa4e75ac50e07cd (diff)
downloadrails-352865d0f835c24daa9a2e9863dcc9dde9e5371a.tar.gz
rails-352865d0f835c24daa9a2e9863dcc9dde9e5371a.tar.bz2
rails-352865d0f835c24daa9a2e9863dcc9dde9e5371a.zip
Merge pull request #29097 from EilisHamilton/fix_uncountable_pluralization_locale
Fix pluralization of uncountables when given a locale
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/inflector_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 14bc10513b..ef956eda90 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -420,6 +420,8 @@ class InflectorTest < ActiveSupport::TestCase
inflect.singular(/es$/, "")
inflect.irregular("el", "los")
+
+ inflect.uncountable("agua")
end
assert_equal("hijos", "hijo".pluralize(:es))
@@ -432,12 +434,17 @@ class InflectorTest < ActiveSupport::TestCase
assert_equal("los", "el".pluralize(:es))
assert_equal("els", "el".pluralize)
+ assert_equal("agua", "agua".pluralize(:es))
+ assert_equal("aguas", "agua".pluralize)
+
ActiveSupport::Inflector.inflections(:es) { |inflect| inflect.clear }
assert ActiveSupport::Inflector.inflections(:es).plurals.empty?
assert ActiveSupport::Inflector.inflections(:es).singulars.empty?
+ assert ActiveSupport::Inflector.inflections(:es).uncountables.empty?
assert !ActiveSupport::Inflector.inflections.plurals.empty?
assert !ActiveSupport::Inflector.inflections.singulars.empty?
+ assert !ActiveSupport::Inflector.inflections.uncountables.empty?
end
def test_clear_all