From 8672a97e11b1a3697b0147b83fd1f812395997a1 Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Sun, 2 May 2010 10:04:32 -0500 Subject: add NullResolver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#4523 state:resolved] Signed-off-by: José Valim --- actionpack/lib/action_view/testing/resolvers.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/lib/action_view/testing') diff --git a/actionpack/lib/action_view/testing/resolvers.rb b/actionpack/lib/action_view/testing/resolvers.rb index f468e57c26..578c56c6c4 100644 --- a/actionpack/lib/action_view/testing/resolvers.rb +++ b/actionpack/lib/action_view/testing/resolvers.rb @@ -31,5 +31,13 @@ module ActionView #:nodoc: templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } end end + + class NullResolver < ActionView::PathResolver + def query(path, exts, formats) + handler, format = extract_handler_and_format(path, formats) + [ActionView::Template.new("Template generated by Null Resolver", path, handler, :virtual_path => path, :format => format)] + end + end + end -- cgit v1.2.3