From dcba72c891295f4c8d82ecb169f8cd225a840cc6 Mon Sep 17 00:00:00 2001 From: Sdogruyol Date: Sat, 14 Nov 2015 23:45:20 +0200 Subject: [PATCH] Added config spec --- spec/config_spec.cr | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 spec/config_spec.cr diff --git a/spec/config_spec.cr b/spec/config_spec.cr new file mode 100644 index 0000000..5f72f10 --- /dev/null +++ b/spec/config_spec.cr @@ -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