Improve kemal.cr

This commit is contained in:
Sdogruyol 2016-02-14 15:15:28 +02:00
parent fe10d210c3
commit 092f5a2e49
13 changed files with 13 additions and 24 deletions

View file

@ -28,5 +28,4 @@ describe "Config" do
config.add_handler CustomTestHandler.new
config.handlers.size.should eq(1)
end
end

View file

@ -27,7 +27,6 @@ describe "Macros" do
logging false
Kemal.config.logging.should eq false
end
it "sets a custom logger" do
config = Kemal::Config::INSTANCE
logger CustomLogHandler.new("production")

View file

@ -109,13 +109,13 @@ describe "Kemal::RouteHandler" do
end
# Removed until there is a way to test multiple middlewares
#it "renders 404 on not found" do
# it "renders 404 on not found" do
# kemal = Kemal::RouteHandler.new
# request = HTTP::Request.new("GET", "/?message=world")
# io_with_context = create_request_and_return_io(kemal, request)
# client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
# client_response.status_code.should eq 404
#end
# end
# it "renders 500 on exception" do
# kemal = Kemal::RouteHandler.new
@ -190,13 +190,13 @@ describe "Kemal::RouteHandler" do
end
# Removed until there is a way to test multiple middlewares
#it "can't process HTTP HEAD requests for undefined GET routes" do
# it "can't process HTTP HEAD requests for undefined GET routes" do
# kemal = Kemal::RouteHandler.new
# request = HTTP::Request.new("HEAD", "/")
# io_with_context = create_request_and_return_io(kemal, request)
# client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
# client_response.status_code.should eq(404)
#end
# end
it "redirects user to provided url" do
kemal = Kemal::RouteHandler.new