aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-05-26 08:55:54 +0200
committerYves Senn <yves.senn@gmail.com>2014-05-26 08:56:26 +0200
commit42fe94891720e081149744cb8ae1e63747f1ff38 (patch)
tree5815ccd8e3b0f7c31f3acf6626221f4d86be9afe /activesupport/test/inflector_test.rb
parent30d420097029328bf9e1c1d4b7a682892b0d4102 (diff)
parent93c193ed825fc4b00079c726ebc1c509daf75acd (diff)
downloadrails-42fe94891720e081149744cb8ae1e63747f1ff38.tar.gz
rails-42fe94891720e081149744cb8ae1e63747f1ff38.tar.bz2
rails-42fe94891720e081149744cb8ae1e63747f1ff38.zip
Merge pull request #15316 from akshay-vishnoi/test-cases
Fix test cases for inflector.rb
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index b0b4738eb3..eb8b0d878e 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -498,10 +498,10 @@ class InflectorTest < ActiveSupport::TestCase
end
%w(plurals singulars uncountables humans acronyms).each do |scope|
- ActiveSupport::Inflector.inflections do |inflect|
- define_method("test_clear_inflections_with_#{scope}") do
- with_dup do
- # clear the inflections
+ define_method("test_clear_inflections_with_#{scope}") do
+ with_dup do
+ # clear the inflections
+ ActiveSupport::Inflector.inflections do |inflect|
inflect.clear(scope)
assert_equal [], inflect.send(scope)
end
@@ -516,9 +516,10 @@ class InflectorTest < ActiveSupport::TestCase
# there are module functions that access ActiveSupport::Inflector.inflections,
# so we need to replace the singleton itself.
def with_dup
- original = ActiveSupport::Inflector::Inflections.instance_variable_get(:@__instance__)
- ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, original.dup)
+ original = ActiveSupport::Inflector::Inflections.instance_variable_get(:@__instance__)[:en]
+ ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, en: original.dup)
+ yield
ensure
- ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, original)
+ ActiveSupport::Inflector::Inflections.instance_variable_set(:@__instance__, en: original)
end
end