set port from .env if specified
This commit is contained in:
@@ -84,7 +84,7 @@ private ######################################################################
|
||||
end
|
||||
|
||||
def base_port
|
||||
options[:port] || 5000
|
||||
options[:port] || environment["PORT"] || 5000
|
||||
end
|
||||
|
||||
def kill_all(signal="SIGTERM")
|
||||
|
||||
@@ -100,6 +100,13 @@ describe "Foreman::Engine", :fakefs do
|
||||
engine.start
|
||||
end
|
||||
|
||||
it "should set port from .env if specified" do
|
||||
File.open(".env", "w") { |f| f.puts("PORT=8017") }
|
||||
engine = Foreman::Engine.new("Procfile")
|
||||
engine.send(:base_port).should == "8017"
|
||||
engine.start
|
||||
end
|
||||
|
||||
it "should be loaded relative to the Procfile" do
|
||||
FileUtils.mkdir_p "/some/app"
|
||||
File.open("/some/app/.env", "w") { |f| f.puts("FOO=qoo") }
|
||||
|
||||
Reference in New Issue
Block a user