aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorDan Pickett <dpickett@enlightsolutions.com>2011-02-07 21:39:46 -0500
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-16 15:08:25 -0200
commit1754bd9b208e8d9207c226d1ffb3cee490856a78 (patch)
tree86880f901243aeeb35bd25bc67e6ed9eb3de1750 /activesupport/test
parent2eed9286ce3af77d29bdd20b4c2a5fa93baf03b1 (diff)
downloadrails-1754bd9b208e8d9207c226d1ffb3cee490856a78.tar.gz
rails-1754bd9b208e8d9207c226d1ffb3cee490856a78.tar.bz2
rails-1754bd9b208e8d9207c226d1ffb3cee490856a78.zip
handle double pluralization for irregular plurals
[#6363] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/inflector_test.rb7
-rw-r--r--activesupport/test/inflector_test_cases.rb1
2 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 60714a152d..f55116dfab 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -63,6 +63,13 @@ class InflectorTest < Test::Unit::TestCase
assert_equal(singular.capitalize, ActiveSupport::Inflector.singularize(plural.capitalize))
end
end
+
+ SingularToPlural.each do |singular, plural|
+ define_method "test_pluralize_#{plural}" do
+ assert_equal(plural, ActiveSupport::Inflector.pluralize(plural))
+ assert_equal(plural.capitalize, ActiveSupport::Inflector.pluralize(plural.capitalize))
+ end
+ end
def test_overwrite_previous_inflectors
assert_equal("series", ActiveSupport::Inflector.singularize("series"))
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb
index 59515dad32..2b144e5931 100644
--- a/activesupport/test/inflector_test_cases.rb
+++ b/activesupport/test/inflector_test_cases.rb
@@ -44,6 +44,7 @@ module InflectorTestCases
"datum" => "data",
"medium" => "media",
+ "stadium" => "stadia",
"analysis" => "analyses",
"node_child" => "node_children",