diff options
author | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-07 14:57:18 -0700 |
---|---|---|
committer | Yehuda Katz and Carl Lerche <wycats@gmail.com> | 2009-04-07 14:57:18 -0700 |
commit | c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830 (patch) | |
tree | c4d08a6227e5a39cb65726fa40c2c54516068d24 /actionpack/test | |
parent | 9c8eaf8e254cf8ccaa6ecae3fdf1f468fbb60db8 (diff) | |
download | rails-c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830.tar.gz rails-c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830.tar.bz2 rails-c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830.zip |
Add depends_on, use, and setup to abstract up ideas about module inheritance.
Diffstat (limited to 'actionpack/test')
5 files changed, 15 insertions, 17 deletions
diff --git a/actionpack/test/abstract_controller/abstract_controller_test.rb b/actionpack/test/abstract_controller/abstract_controller_test.rb index 96193fd24c..6d33888821 100644 --- a/actionpack/test/abstract_controller/abstract_controller_test.rb +++ b/actionpack/test/abstract_controller/abstract_controller_test.rb @@ -27,7 +27,7 @@ module AbstractController # Test Render mixin # ==== class RenderingController < AbstractController::Base - include Renderer + use Renderer def _prefix() end @@ -116,7 +116,7 @@ module AbstractController # ==== # self._layout is used when defined class WithLayouts < PrefixedViews - include Layouts + use Layouts private def self.layout(formats) diff --git a/actionpack/test/abstract_controller/callbacks_test.rb b/actionpack/test/abstract_controller/callbacks_test.rb index 89243b631e..5fce30f478 100644 --- a/actionpack/test/abstract_controller/callbacks_test.rb +++ b/actionpack/test/abstract_controller/callbacks_test.rb @@ -4,7 +4,7 @@ module AbstractController module Testing class ControllerWithCallbacks < AbstractController::Base - include AbstractController::Callbacks + use AbstractController::Callbacks end class Callback1 < ControllerWithCallbacks diff --git a/actionpack/test/abstract_controller/helper_test.rb b/actionpack/test/abstract_controller/helper_test.rb index e1b2141331..6284fa4f70 100644 --- a/actionpack/test/abstract_controller/helper_test.rb +++ b/actionpack/test/abstract_controller/helper_test.rb @@ -4,8 +4,8 @@ module AbstractController module Testing class ControllerWithHelpers < AbstractController::Base - include Renderer - include Helpers + use Renderer + use Helpers def render(string) super(:_template_name => string) diff --git a/actionpack/test/abstract_controller/layouts_test.rb b/actionpack/test/abstract_controller/layouts_test.rb index 838a44be12..ec8faffc51 100644 --- a/actionpack/test/abstract_controller/layouts_test.rb +++ b/actionpack/test/abstract_controller/layouts_test.rb @@ -5,8 +5,8 @@ module AbstractControllerTests # Base controller for these tests class Base < AbstractController::Base - include AbstractController::Renderer - include AbstractController::Layouts + use AbstractController::Renderer + use AbstractController::Layouts self.view_paths = [ActionView::FixtureTemplate::FixturePath.new( "layouts/hello.erb" => "With String <%= yield %>", diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb index 420abe58f7..9058060059 100644 --- a/actionpack/test/new_base/test_helper.rb +++ b/actionpack/test/new_base/test_helper.rb @@ -26,16 +26,14 @@ require 'rack/test' module ActionController class Base2 < AbstractBase - include AbstractController::Callbacks - include AbstractController::Renderer - include AbstractController::Helpers - include AbstractController::Layouts - include AbstractController::Logger - - include ActionController::HideActions - include ActionController::UrlFor - include ActionController::Layouts - include ActionController::Renderer + use AbstractController::Callbacks + use AbstractController::Helpers + use AbstractController::Logger + + use ActionController::HideActions + use ActionController::UrlFor + use ActionController::Renderer + use ActionController::Layouts def self.inherited(klass) ::ActionController::Base2.subclasses << klass.to_s |