diff options
-rw-r--r-- | activerecord/test/cases/validations/i18n_generate_message_validation_test.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb b/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb index 136a336cec..a8e513d81f 100644 --- a/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb +++ b/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb @@ -8,11 +8,12 @@ class I18nGenerateMessageValidationTest < ActiveRecord::TestCase I18n.backend = I18n::Backend::Simple.new end - def reset_i18n_load_path(&block) + def reset_i18n_load_path @old_load_path, @old_backend = I18n.load_path.dup, I18n.backend I18n.load_path.clear I18n.backend = I18n::Backend::Simple.new yield + ensure I18n.load_path.replace @old_load_path I18n.backend = @old_backend end |