diff --git a/spec/config_spec.cr b/spec/config_spec.cr index 9ea27bc..65c44e7 100644 --- a/spec/config_spec.cr +++ b/spec/config_spec.cr @@ -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. #