Merge pull request #199 from atog/master

set port from .env if specified
This commit is contained in:
David Dollar
2012-05-16 15:06:56 -07:00
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ private ######################################################################
end
def base_port
options[:port] || 5000
options[:port] || environment["PORT"] || ENV["PORT"] || 5000
end
def kill_all(signal="SIGTERM")
+7
View File
@@ -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") }