mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
clarify startup message in test mode (#687)
This commit is contained in:
parent
0afbd129f5
commit
3243b8e0e0
2 changed files with 8 additions and 4 deletions
|
@ -26,7 +26,7 @@ describe "Run" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "runs without a block being specified" do
|
it "runs without a block being specified" do
|
||||||
run(<<-CR).should eq "[test] Kemal is ready to lead at http://0.0.0.0:3000\ntrue\n"
|
run(<<-CR).should contain "[test] Kemal is running in test mode."
|
||||||
Kemal.config.env = "test"
|
Kemal.config.env = "test"
|
||||||
Kemal.run
|
Kemal.run
|
||||||
puts Kemal.config.running
|
puts Kemal.config.running
|
||||||
|
@ -34,7 +34,7 @@ describe "Run" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "allows custom HTTP::Server bind" do
|
it "allows custom HTTP::Server bind" do
|
||||||
run(<<-CR).should eq "[test] Kemal is ready to lead at http://127.0.0.1:3000, http://0.0.0.0:3001\n"
|
run(<<-CR).should contain "[test] Kemal is running in test mode."
|
||||||
Kemal.config.env = "test"
|
Kemal.config.env = "test"
|
||||||
Kemal.run do |config|
|
Kemal.run do |config|
|
||||||
server = config.server.not_nil!
|
server = config.server.not_nil!
|
||||||
|
|
|
@ -66,8 +66,12 @@ module Kemal
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.display_startup_message(config, server)
|
def self.display_startup_message(config, server)
|
||||||
addresses = server.addresses.join ", " { |address| "#{config.scheme}://#{address}" }
|
if config.env != "test"
|
||||||
log "[#{config.env}] #{config.app_name} is ready to lead at #{addresses}"
|
addresses = server.addresses.join ", " { |address| "#{config.scheme}://#{address}" }
|
||||||
|
log "[#{config.env}] #{config.app_name} is ready to lead at #{addresses}"
|
||||||
|
else
|
||||||
|
log "[#{config.env}] #{config.app_name} is running in test mode. Server not listening"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.stop
|
def self.stop
|
||||||
|
|
Loading…
Reference in a new issue