]> git.openstreetmap.org Git - rails.git/blobdiff - test/test_helper.rb
Make all translation lookup errors throw exceptions in test mode
[rails.git] / test / test_helper.rb
index 05385b4f9c8678b85b207e352fe047e52bb9956c..4d9372148f270cd447df619f1c438f2f4335b238 100644 (file)
@@ -42,6 +42,18 @@ module ActiveSupport
       end
     end
 
+    ##
+    # execute a block with missing translation exceptions suppressed
+    def without_i18n_exceptions
+      exception_handler = I18n.exception_handler
+      begin
+        I18n.exception_handler = nil
+        yield
+      ensure
+        I18n.exception_handler = exception_handler
+      end
+    end
+
     ##
     # work round minitest insanity that causes it to tell you
     # to use assert_nil to test for nil, which is fine if you're