mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Added config spec
This commit is contained in:
parent
db48f40fe6
commit
dcba72c891
1 changed files with 20 additions and 0 deletions
20
spec/config_spec.cr
Normal file
20
spec/config_spec.cr
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
require "./spec_helper"
|
||||||
|
|
||||||
|
class CustomTestHandler < HTTP::Handler
|
||||||
|
def call(request)
|
||||||
|
call_next request
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "Config" do
|
||||||
|
it "sets default port to 3000" do
|
||||||
|
config = Kemal.config
|
||||||
|
config.port.should eq 3000
|
||||||
|
end
|
||||||
|
|
||||||
|
it "adds a custom handler" do
|
||||||
|
config = Kemal.config
|
||||||
|
config.add_handler CustomTestHandler.new
|
||||||
|
config.handlers.size.should eq(1)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue