diff options
author | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2014-05-25 21:36:02 +0530 |
---|---|---|
committer | Akshay Vishnoi <akshay.vishnoi@vinsol.com> | 2014-05-25 21:36:02 +0530 |
commit | 93c193ed825fc4b00079c726ebc1c509daf75acd (patch) | |
tree | 7584beb604fd4a679355034b82eb2e267e5c402c /activesupport | |
parent | 21ec7fefea5a1b823cb88733b019b3d52240801d (diff) | |
download | rails-93c193ed825fc4b00079c726ebc1c509daf75acd.tar.gz rails-93c193ed825fc4b00079c726ebc1c509daf75acd.tar.bz2 rails-93c193ed825fc4b00079c726ebc1c509daf75acd.zip |
Fix test cases for inflector.rb
`yield` was missing in #with_dup, due to which 57 assertions were not running
in real, and all tests were passing by default.
Error was introduced in commit - 31ceb5e.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/inflector_test.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index b0b4738eb3..8168581a59 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 |