Permalink
Browse files

move FixtureResolver to a file that is accessible outside Rails' own …

…tests

[#4522 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent a76c7e6 commit 91125f9927ffbe1a16494910ae0e8228a4400439 @dchelimsky dchelimsky committed with josevalim May 2, 2010
@@ -1,4 +1,10 @@
+require 'action_view/template/resolver'
+
module ActionView #:nodoc:
+ # Use FixtureResolver in your tests to simulate the presence of files on the
+ # file system. This is used internally by Rails' own test suite, and is
+ # useful for testing extensions that have no way of knowing what the file
+ # system will look like at runtime.
class FixtureResolver < PathResolver
attr_reader :hash
@@ -24,6 +30,6 @@ def query(path, exts, formats)
templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size }
end
-
end
-end
+end
+
@@ -16,8 +16,8 @@
require 'abstract_controller'
require 'action_controller'
require 'action_view'
+require 'action_view/testing/resolvers'
require 'action_dispatch'
-require 'fixture_template'
require 'active_support/dependencies'
require 'active_model'
@@ -10,8 +10,6 @@
ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../fixtures/layout_tests/' ]
-require "fixture_template"
-
class LayoutTest < ActionController::Base
def self.controller_path; 'views' end
def self._implied_layout_name; to_s.underscore.gsub(/_controller$/, '') ; end

0 comments on commit 91125f9

Please sign in to comment.