lib/exception_handling/testing.rb in exception_handling-2.6.1 vs lib/exception_handling/testing.rb in exception_handling-2.7.0.pre.1
- old
+ new
@@ -2,11 +2,11 @@
# some useful test objects
module ExceptionHandling
module Testing
- class ControllerStub
+ class ControllerStubBase
class Request
attr_accessor :parameters, :protocol, :host, :request_uri, :env, :session_options
def initialize
@@ -23,11 +23,11 @@
class << self
attr_accessor :around_filter_method
def around_filter(method)
- ControllerStub.around_filter_method = method
+ self.around_filter_method = method
end
end
def initialize
@request = Request.new
@@ -42,26 +42,36 @@
else
{}
end
end
- def simulate_around_filter(&block)
- set_current_controller(&block)
- end
-
- def controller_name
- "ControllerStub"
- end
-
def action_name
"test_action"
end
def complete_request_uri
"#{@request.protocol}#{@request.host}#{@request.request_uri}"
end
+ end
+ class LoggingMethodsControllerStub < ControllerStubBase
+ include ExceptionHandling::LoggingMethods
+
+ def controller_name
+ "LoggingMethodsControllerStub"
+ end
+ end
+
+ class MethodsControllerStub < ControllerStubBase
include ExceptionHandling::Methods
set_long_controller_action_timeout 2
+
+ def simulate_around_filter(&block)
+ set_current_controller(&block)
+ end
+
+ def controller_name
+ "MethodsControllerStub"
+ end
end
end
end