aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-09-28 17:08:43 -0300
committerEmilio Tagua <miloops@gmail.com>2010-09-28 17:08:43 -0300
commit3f94b45262577b70a1d9f3aea45e0e4f07a2bbaa (patch)
treed14e3305aadd3c29f31e5fa45c5b2ce27ef770be
parent19d9fffb9b8350b03cf8b1e3a3249eba06d22c1a (diff)
downloadrails-3f94b45262577b70a1d9f3aea45e0e4f07a2bbaa.tar.gz
rails-3f94b45262577b70a1d9f3aea45e0e4f07a2bbaa.tar.bz2
rails-3f94b45262577b70a1d9f3aea45e0e4f07a2bbaa.zip
Remove more warnings: no need to define attr_accessor if already exists. Initialize ivar.
-rw-r--r--actionpack/lib/action_controller/test_case.rb8
-rw-r--r--actionpack/test/controller/render_test.rb1
2 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index f1ff57f0cb..70a5de7f30 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -462,9 +462,11 @@ module ActionController
# The exception is stored in the exception accessor for further inspection.
module RaiseActionExceptions
def self.included(base)
- base.class_eval do
- attr_accessor :exception
- protected :exception, :exception=
+ unless base.method_defined?(:exception) && base.method_defined?(:exception=)
+ base.class_eval do
+ attr_accessor :exception
+ protected :exception, :exception=
+ end
end
end
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 42723c834e..5d1341af1b 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -327,6 +327,7 @@ class TestController < ActionController::Base
end
def default_render
+ @alternate_default_render ||= nil
if @alternate_default_render
@alternate_default_render.call
else