aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-11-28 10:16:46 -0800
committerYves Senn <yves.senn@gmail.com>2013-11-28 10:16:46 -0800
commit0ff2d2603e0a6554118cd48e25e94e9ffcbbb8cc (patch)
tree4a6aef2b9d6d63d0bb5fce00a6919d92389dc028 /activesupport/test
parent598779b749bfed0a56e0d3f10ac824b2477ae745 (diff)
parent534b36093d4a2eee564fe3993b20af9a3397886e (diff)
downloadrails-0ff2d2603e0a6554118cd48e25e94e9ffcbbb8cc.tar.gz
rails-0ff2d2603e0a6554118cd48e25e94e9ffcbbb8cc.tar.bz2
rails-0ff2d2603e0a6554118cd48e25e94e9ffcbbb8cc.zip
Merge pull request #13084 from lihanli/series-singularize-fix
Fix an activesupport inflector test changing the inflector but not reverting all its changes afterwards
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/inflector_test.rb9
-rw-r--r--activesupport/test/inflector_test_cases.rb1
2 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 6184df481f..35967ba656 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -70,10 +70,11 @@ class InflectorTest < ActiveSupport::TestCase
def test_overwrite_previous_inflectors
- assert_equal("series", ActiveSupport::Inflector.singularize("series"))
- ActiveSupport::Inflector.inflections.singular "series", "serie"
- assert_equal("serie", ActiveSupport::Inflector.singularize("series"))
- ActiveSupport::Inflector.inflections.uncountable "series" # Return to normal
+ with_dup do
+ assert_equal("series", ActiveSupport::Inflector.singularize("series"))
+ ActiveSupport::Inflector.inflections.singular "series", "serie"
+ assert_equal("serie", ActiveSupport::Inflector.singularize("series"))
+ end
end
MixtureToTitleCase.each_with_index do |(before, titleized), index|
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb
index b34a946baf..4bd1b2e47c 100644
--- a/activesupport/test/inflector_test_cases.rb
+++ b/activesupport/test/inflector_test_cases.rb
@@ -63,6 +63,7 @@ module InflectorTestCases
"news" => "news",
"series" => "series",
+ "miniseries" => "miniseries",
"species" => "species",
"quiz" => "quizzes",