diff options
author | David Chelimsky <dchelimsky@gmail.com> | 2010-05-02 09:20:17 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-02 22:45:54 +0200 |
commit | 91125f9927ffbe1a16494910ae0e8228a4400439 (patch) | |
tree | 1af9a8f241007153e6c35bd3cc41489dccd043c7 | |
parent | a76c7e68d5e39f5962d9cb85c98e6a8e96f8b3af (diff) | |
download | rails-91125f9927ffbe1a16494910ae0e8228a4400439.tar.gz rails-91125f9927ffbe1a16494910ae0e8228a4400439.tar.bz2 rails-91125f9927ffbe1a16494910ae0e8228a4400439.zip |
move FixtureResolver to a file that is accessible outside Rails' own tests
[#4522 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | actionpack/lib/action_view/testing/resolvers.rb (renamed from actionpack/test/lib/fixture_template.rb) | 10 | ||||
-rw-r--r-- | actionpack/test/abstract_unit.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/layout_test.rb | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/actionpack/test/lib/fixture_template.rb b/actionpack/lib/action_view/testing/resolvers.rb index b49ccd39ca..f468e57c26 100644 --- a/actionpack/test/lib/fixture_template.rb +++ b/actionpack/lib/action_view/testing/resolvers.rb @@ -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 @@ module ActionView #:nodoc: templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } end - end -end
\ No newline at end of file +end + diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index f3ff258016..89ba0990f1 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -16,8 +16,8 @@ require 'test/unit' 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' diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb index 48be7571ea..165c61ffad 100644 --- a/actionpack/test/controller/layout_test.rb +++ b/actionpack/test/controller/layout_test.rb @@ -10,8 +10,6 @@ ActionView::Template::register_template_handler :mab, 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 |