test/unit/error_handler_tests.rb in deas-0.43.3 vs test/unit/error_handler_tests.rb in deas-0.43.4
- old
+ new
@@ -10,25 +10,25 @@
# 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
+ @route_path = Factory.string
@handler_class = Factory.string
@handler = Factory.string
@params = Factory.string
@splat = Factory.string
- @route_path = Factory.string
@context_hash = {
:server_data => @server_data,
:request => @request,
:response => @response,
+ :route_path => @route_path,
:handler_class => @handler_class,
:handler => @handler,
:params => @params,
- :splat => @splat,
- :route_path => @route_path
+ :splat => @splat
}
@error_handler_class = Deas::ErrorHandler
end
subject{ @error_handler_class }
@@ -115,36 +115,36 @@
@context = Context.new(@context_hash)
end
subject{ @context }
should have_readers :server_data
- should have_readers :request, :response, :handler_class, :handler
- should have_readers :params, :splat, :route_path
+ should have_readers :request, :response
+ should have_readers :route_path, :handler_class, :handler, :params, :splat
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[:route_path], subject.route_path
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({
:server_data => Factory.server_data,
:request => Factory.string,
:response => Factory.string,
+ :route_path => 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