diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-13 03:49:52 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-13 03:49:52 +0000 |
commit | 83c8db981892820b747390d854595268afade8dd (patch) | |
tree | acd18fb1a33668e50d754133c1f904317b49fdb2 /actionpack/test | |
parent | 9c0fe36d461264552198cdde493e91bd7c26c57c (diff) | |
download | rails-83c8db981892820b747390d854595268afade8dd.tar.gz rails-83c8db981892820b747390d854595268afade8dd.tar.bz2 rails-83c8db981892820b747390d854595268afade8dd.zip |
Deprecation: remove deprecated instance variables.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6399 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
31 files changed, 3 insertions, 113 deletions
diff --git a/actionpack/test/controller/deprecated_instance_variables_test.rb b/actionpack/test/controller/deprecated_instance_variables_test.rb deleted file mode 100644 index 7865a69e30..0000000000 --- a/actionpack/test/controller/deprecated_instance_variables_test.rb +++ /dev/null @@ -1,48 +0,0 @@ -require File.dirname(__FILE__) + '/../abstract_unit' - -class DeprecatedControllerInstanceVariablesTest < Test::Unit::TestCase - class Target < ActionController::Base - def initialize(run = nil) - instance_eval(run) if run - super() - end - - def noop - render :nothing => true - end - - ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| - class_eval "def old_#{var}; render :text => @#{var}.to_s end" - class_eval "def new_#{var}; render :text => #{var}.to_s end" - class_eval "def internal_#{var}; render :text => @_#{var}.to_s end" - end - - def rescue_action(e) raise e end - end - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = Target.new - end - - ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| - class_eval <<-end_eval, __FILE__, __LINE__ - def test_old_#{var}_is_deprecated - assert_deprecated('@#{var}') { get :old_#{var} } - end - def test_new_#{var}_isnt_deprecated - assert_not_deprecated { get :new_#{var} } - end - def test_internal_#{var}_isnt_deprecated - assert_not_deprecated { get :internal_#{var} } - end - def test_#{var}_raises_if_already_set - assert_raise(RuntimeError) do - @controller = Target.new '@#{var} = Object.new' - get :noop - end - end - end_eval - end -end diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 3eb84e6d24..0765772e06 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -460,14 +460,9 @@ class NewRenderTest < Test::Unit::TestCase ActionController::Base.protected_variables_cache = nil get :hello_world - assert assigns.include?('request'), 'request should be in assigns' - assert_deprecated 'request' do - assert_kind_of ActionController::AbstractRequest, assigns['request'] - end - assert_not_deprecated do - assert_kind_of ActionController::AbstractRequest, @response.template.request - assert_kind_of ActionController::AbstractRequest, assigns['_request'] - end + assert !assigns.include?('request'), 'request should not be in assigns' + assert_kind_of ActionController::AbstractRequest, assigns['_request'] + assert_kind_of ActionController::AbstractRequest, @response.template.request ensure ActionController::Base.view_controller_internals = view_internals_old_value diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb deleted file mode 100644 index 4e8a2d804c..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @cookies[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb deleted file mode 100644 index 68e88bb746..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= cookies[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb deleted file mode 100644 index 4b4782b287..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @flash[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb deleted file mode 100644 index f7f9d0913a..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= flash[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb deleted file mode 100644 index 1176c93ad8..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @headers[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb deleted file mode 100644 index 308c4eb6ba..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= headers[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb deleted file mode 100644 index 1eea68757f..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @params[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb deleted file mode 100644 index 7e349b4ca0..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_params_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= params[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_params_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_params_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_params_method.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb deleted file mode 100644 index a1680c23d5..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @request.method %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb deleted file mode 100644 index 0c74cf1c1b..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_request_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= request.method %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_request_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_request_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_request_method.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb deleted file mode 100644 index 2f12d2ce32..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @response.body %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb deleted file mode 100644 index 948c75929a..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_response_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= response.body %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_response_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_response_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_response_method.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb b/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb deleted file mode 100644 index 3acc1b8529..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @session[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +++ /dev/null diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb b/actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb deleted file mode 100644 index a899387c47..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_session_method.erb +++ /dev/null @@ -1 +0,0 @@ -<%= session[:test] %> diff --git a/actionpack/test/fixtures/deprecated_instance_variables/_session_method.rhtml b/actionpack/test/fixtures/deprecated_instance_variables/_session_method.rhtml deleted file mode 100644 index e69de29bb2..0000000000 --- a/actionpack/test/fixtures/deprecated_instance_variables/_session_method.rhtml +++ /dev/null diff --git a/actionpack/test/template/deprecated_instance_variables_test.rb b/actionpack/test/template/deprecated_instance_variables_test.rb deleted file mode 100644 index d3cffbc1e9..0000000000 --- a/actionpack/test/template/deprecated_instance_variables_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -require "#{File.dirname(__FILE__)}/../abstract_unit" - -class DeprecatedViewInstanceVariablesTest < Test::Unit::TestCase - class DeprecatedInstanceVariablesController < ActionController::Base - self.view_paths = [ "#{File.dirname(__FILE__)}/../fixtures/" ] - - def self.controller_path; 'deprecated_instance_variables' end - - ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| - class_eval <<-end_eval - def old_#{var}_inline; render :inline => '<%= @#{var}.to_s %>' end - def new_#{var}_inline; render :inline => '<%= #{var}.to_s %>' end - def old_#{var}_partial; render :partial => '#{var}_ivar' end - def new_#{var}_partial; render :partial => '#{var}_method' end - end_eval - end - - def rescue_action(e) raise e end - end - - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller = DeprecatedInstanceVariablesController.new - end - - ActionController::Base::DEPRECATED_INSTANCE_VARIABLES.each do |var| - class_eval <<-end_eval, __FILE__, __LINE__ - def test_old_#{var}_is_deprecated - assert_deprecated('@#{var}') { get :old_#{var}_inline } - end - def test_new_#{var}_isnt_deprecated - assert_not_deprecated { get :new_#{var}_inline } - end - def test_old_#{var}_partial_is_deprecated - assert_deprecated('@#{var}') { get :old_#{var}_partial } - end - def test_new_#{var}_partial_isnt_deprecated - assert_not_deprecated { get :new_#{var}_partial } - end - end_eval - end -end |