test/unit/error_handler_tests.rb in deas-0.42.0 vs test/unit/error_handler_tests.rb in deas-0.43.0
- old
+ new
@@ -10,24 +10,26 @@
# positives
@error_proc_spies = (Factory.integer(3) + 1).times.map{ ErrorProcSpy.new }
@server_data = Factory.server_data(:error_procs => @error_proc_spies)
@request = Factory.string
@response = Factory.string
- @handler_class = Factory.string
+ @handler_class = Deas::ErrorHandler
@handler = Factory.string
@params = Factory.string
+ @splat = Factory.string
+ @route_path = Factory.string
@context_hash = {
:server_data => @server_data,
:request => @request,
:response => @response,
:handler_class => @handler_class,
:handler => @handler,
:params => @params,
+ :splat => @splat,
+ :route_path => @route_path
}
-
- @handler_class = Deas::ErrorHandler
end
subject{ @handler_class }
should have_imeths :run
@@ -111,25 +113,37 @@
@context = Context.new(@context_hash)
end
subject{ @context }
should have_readers :server_data
- should have_readers :request, :response, :handler_class, :handler, :params
+ should have_readers :request, :response, :handler_class, :handler
+ should have_readers :params, :splat, :route_path
should "know its attributes" do
assert_equal @context_hash[:server_data], subject.server_data
assert_equal @context_hash[:request], subject.request
assert_equal @context_hash[:response], subject.response
assert_equal @context_hash[:handler_class], subject.handler_class
assert_equal @context_hash[:handler], subject.handler
assert_equal @context_hash[:params], subject.params
+ assert_equal @context_hash[:splat], subject.splat
+ assert_equal @context_hash[:route_path], subject.route_path
end
should "know if it equals another context" do
exp = Context.new(@context_hash)
assert_equal exp, subject
- exp = Context.new({})
+ exp = Context.new({
+ :server_data => Factory.server_data,
+ :request => Factory.string,
+ :response => Factory.string,
+ :handler_class => Factory.string,
+ :handler => Factory.string,
+ :params => Factory.string,
+ :splat => Factory.string,
+ :route_path => Factory.string
+ })
assert_not_equal exp, subject
end
end