From d0f46ec8d9cb6849d83ad44c35018c9960a0fb95 Mon Sep 17 00:00:00 2001 From: lebogan Date: Sun, 15 Jul 2018 15:22:50 -0700 Subject: [PATCH 1/3] add version constant --- spec/config_spec.cr | 10 +++++++++- src/kemal/config.cr | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/config_spec.cr b/spec/config_spec.cr index 9ea27bc..d209b18 100644 --- a/spec/config_spec.cr +++ b/spec/config_spec.cr @@ -25,7 +25,7 @@ describe "Config" do config.host_binding.should eq "127.0.0.1" end - it "adds a custom handler" do + pending "adds a custom handler" do config = Kemal.config config.add_handler CustomTestHandler.new Kemal.config.setup @@ -54,4 +54,12 @@ describe "Config" do Kemal::CLI.new test_option.should eq("FOOBAR") end + + it "returns a string" do + Kemal::VERSION.should be_a(String) + end + + it "gets the version from shards.yml" do + Kemal::VERSION.should eq("0.23.0") + end end diff --git a/src/kemal/config.cr b/src/kemal/config.cr index d865c5e..508ec36 100644 --- a/src/kemal/config.cr +++ b/src/kemal/config.cr @@ -1,4 +1,6 @@ module Kemal + VERSION = {{ `shards version #{__DIR__}`.chomp.stringify }} + # Stores all the configuration options for a Kemal application. # It's a singleton and you can access it like. # From 047cff93d3e87bd788b51f2838dcc091c11c3c66 Mon Sep 17 00:00:00 2001 From: lebogan Date: Sun, 15 Jul 2018 15:36:06 -0700 Subject: [PATCH 2/3] remove pending from config_spec --- spec/config_spec.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/config_spec.cr b/spec/config_spec.cr index d209b18..65c44e7 100644 --- a/spec/config_spec.cr +++ b/spec/config_spec.cr @@ -25,7 +25,7 @@ describe "Config" do config.host_binding.should eq "127.0.0.1" end - pending "adds a custom handler" do + it "adds a custom handler" do config = Kemal.config config.add_handler CustomTestHandler.new Kemal.config.setup From 320660aad45e772a310c31b8874a27126b30efe2 Mon Sep 17 00:00:00 2001 From: lebogan Date: Tue, 24 Jul 2018 09:55:59 -0700 Subject: [PATCH 3/3] remove tests with embedded version literal --- spec/config_spec.cr | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/config_spec.cr b/spec/config_spec.cr index 65c44e7..291f93b 100644 --- a/spec/config_spec.cr +++ b/spec/config_spec.cr @@ -55,11 +55,7 @@ describe "Config" do test_option.should eq("FOOBAR") end - it "returns a string" do - Kemal::VERSION.should be_a(String) - end - it "gets the version from shards.yml" do - Kemal::VERSION.should eq("0.23.0") + Kemal::VERSION.should_not be("") end end