Skip to content

Commit

Permalink
move FixtureResolver to a file that is accessible outside Rails' own …
Browse files Browse the repository at this point in the history
…tests

[#4522 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
dchelimsky authored and josevalim committed May 2, 2010
1 parent a76c7e6 commit 91125f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
@@ -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

Expand All @@ -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

2 changes: 1 addition & 1 deletion actionpack/test/abstract_unit.rb
Expand Up @@ -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'

Expand Down
2 changes: 0 additions & 2 deletions actionpack/test/controller/layout_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 91125f9

Please sign in to comment.