aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-16 11:20:28 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-16 11:20:28 -0700
commita6e803bee124073f5d82d3264b3cdbcbf4d957d5 (patch)
tree21cc149952730984cf2f9ab7761887c9187f93b0 /actionpack
parent18c3b77b2381e9f7072d595fa9f599b0994852a7 (diff)
downloadrails-a6e803bee124073f5d82d3264b3cdbcbf4d957d5.tar.gz
rails-a6e803bee124073f5d82d3264b3cdbcbf4d957d5.tar.bz2
rails-a6e803bee124073f5d82d3264b3cdbcbf4d957d5.zip
Remove exceptions from AbstractUnit so they work in real life
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller.rb12
-rw-r--r--actionpack/test/abstract_unit.rb59
2 files changed, 13 insertions, 58 deletions
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb
index 073600f69b..e822a11d14 100644
--- a/actionpack/lib/action_controller.rb
+++ b/actionpack/lib/action_controller.rb
@@ -40,6 +40,18 @@ module ActionController
autoload :Translation, 'action_controller/translation'
autoload :Cookies, 'action_controller/base/cookies'
+ autoload :ActionControllerError, 'action_controller/base/exceptions'
+ autoload :SessionRestoreError, 'action_controller/base/exceptions'
+ autoload :RenderError, 'action_controller/base/exceptions'
+ autoload :RoutingError, 'action_controller/base/exceptions'
+ autoload :MethodNotAllowed, 'action_controller/base/exceptions'
+ autoload :NotImplemented, 'action_controller/base/exceptions'
+ autoload :UnknownController, 'action_controller/base/exceptions'
+ autoload :MissingFile, 'action_controller/base/exceptions'
+ autoload :RenderError, 'action_controller/base/exceptions'
+ autoload :SessionOverflowError, 'action_controller/base/exceptions'
+ autoload :UnknownHttpMethod, 'action_controller/base/exceptions'
+
require 'action_controller/routing'
end
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index a7957ed944..1333a9d71a 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -15,7 +15,7 @@ require 'active_support/test_case'
require 'action_controller/abstract'
require 'action_controller'
require 'fixture_template'
-require 'action_controller/testing/process2'
+require 'action_controller/testing/process'
require 'action_view/test_case'
require 'action_controller/testing/integration'
require 'active_support/dependencies'
@@ -59,63 +59,6 @@ module ActionController
}
Base.session_store = nil
- class ActionControllerError < StandardError #:nodoc:
- end
-
- class SessionRestoreError < ActionControllerError #:nodoc:
- end
-
- class RenderError < ActionControllerError #:nodoc:
- end
-
- class RoutingError < ActionControllerError #:nodoc:
- attr_reader :failures
- def initialize(message, failures=[])
- super(message)
- @failures = failures
- end
- end
-
- class MethodNotAllowed < ActionControllerError #:nodoc:
- attr_reader :allowed_methods
-
- def initialize(*allowed_methods)
- super("Only #{allowed_methods.to_sentence(:locale => :en)} requests are allowed.")
- @allowed_methods = allowed_methods
- end
-
- def allowed_methods_header
- allowed_methods.map { |method_symbol| method_symbol.to_s.upcase } * ', '
- end
-
- def handle_response!(response)
- response.headers['Allow'] ||= allowed_methods_header
- end
- end
-
- class NotImplemented < MethodNotAllowed #:nodoc:
- end
-
- class UnknownController < ActionControllerError #:nodoc:
- end
-
- class MissingFile < ActionControllerError #:nodoc:
- end
-
- class RenderError < ActionControllerError #:nodoc:
- end
-
- class SessionOverflowError < ActionControllerError #:nodoc:
- DEFAULT_MESSAGE = 'Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data.'
-
- def initialize(message = nil)
- super(message || DEFAULT_MESSAGE)
- end
- end
-
- class UnknownHttpMethod < ActionControllerError #:nodoc:
- end
-
class Base
include ActionController::Testing
end