Permalink
Browse files

Merge pull request #13084 from lihanli/series-singularize-fix

Fix an activesupport inflector test changing the inflector but not reverting all its changes afterwards
  • Loading branch information...
2 parents 598779b + 534b360 commit 0ff2d2603e0a6554118cd48e25e94e9ffcbbb8cc @senny senny committed Nov 28, 2013
Showing with 6 additions and 4 deletions.
  1. +5 −4 activesupport/test/inflector_test.rb
  2. +1 −0 activesupport/test/inflector_test_cases.rb
View
9 activesupport/test/inflector_test.rb
@@ -70,10 +70,11 @@ def test_uncountable_word_is_not_greedy
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|
View
1 activesupport/test/inflector_test_cases.rb
@@ -63,6 +63,7 @@ module InflectorTestCases
"news" => "news",
"series" => "series",
+ "miniseries" => "miniseries",
"species" => "species",
"quiz" => "quizzes",

0 comments on commit 0ff2d26

Please sign in to comment.