aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/actionpack/controller/layout_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/actionpack/controller/layout_test.rb')
-rw-r--r--actionview/test/actionpack/controller/layout_test.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/actionview/test/actionpack/controller/layout_test.rb b/actionview/test/actionpack/controller/layout_test.rb
index 70d81c0cad..bd345fe873 100644
--- a/actionview/test/actionpack/controller/layout_test.rb
+++ b/actionview/test/actionpack/controller/layout_test.rb
@@ -1,7 +1,6 @@
require 'abstract_unit'
require 'rbconfig'
require 'active_support/core_ext/array/extract_options'
-require 'support/template_handler_helper'
# The view_paths array must be set on Base and not LayoutTest so that LayoutTest's inherited
# method has access to the view_paths array when looking for a layout to automatically assign.
@@ -15,6 +14,15 @@ class LayoutTest < ActionController::Base
self.view_paths = ActionController::Base.view_paths.dup
end
+module TemplateHandlerHelper
+ def with_template_handler(*extensions, handler)
+ ActionView::Template.register_template_handler(*extensions, handler)
+ yield
+ ensure
+ ActionView::Template.unregister_template_handler(*extensions)
+ end
+end
+
# Restore view_paths to previous value
ActionController::Base.view_paths = old_load_paths