Re-name the main Foreman::Engine method to #run to avoid a name collision with #start(name)
This commit is contained in:
1 parent
38aecff886
commit
de62d0655e
4 files changed
+10
-10
No files matched your search
+1
-1
@@ -30,7 +30,7 @@ class Foreman::CLI < Thor
|
|||||||
def start(process=nil)
|
def start(process=nil)
|
||||||
check_procfile!
|
check_procfile!
|
||||||
engine.options[:concurrency] = "#{process}=1" if process
|
engine.options[:concurrency] = "#{process}=1" if process
|
||||||
engine.start
|
engine.run
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "export FORMAT LOCATION", "Export the application to another process management format"
|
desc "export FORMAT LOCATION", "Export the application to another process management format"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Foreman::Engine
|
|||||||
@output_mutex = Mutex.new
|
@output_mutex = Mutex.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def start
|
def run
|
||||||
proctitle "ruby: foreman master"
|
proctitle "ruby: foreman master"
|
||||||
termtitle "#{File.basename(@directory)} - foreman"
|
termtitle "#{File.basename(@directory)} - foreman"
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe "Foreman::CLI", :fakefs do
|
|||||||
|
|
||||||
it "runs successfully" do
|
it "runs successfully" do
|
||||||
dont_allow(subject).error
|
dont_allow(subject).error
|
||||||
mock.instance_of(Foreman::Engine).start
|
mock.instance_of(Foreman::Engine).run
|
||||||
subject.start
|
subject.start
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "start" do
|
describe "run" do
|
||||||
it "forks the processes" do
|
it "forks the processes" do
|
||||||
write_procfile
|
write_procfile
|
||||||
mock.instance_of(Foreman::Process).run_process(Dir.pwd, "./alpha", is_a(IO))
|
mock.instance_of(Foreman::Process).run_process(Dir.pwd, "./alpha", is_a(IO))
|
||||||
@@ -36,7 +36,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
mock(subject).watch_for_output
|
mock(subject).watch_for_output
|
||||||
mock(subject).watch_for_termination
|
mock(subject).watch_for_termination
|
||||||
mock(subject).terminate_gracefully
|
mock(subject).terminate_gracefully
|
||||||
subject.start
|
subject.run
|
||||||
end
|
end
|
||||||
|
|
||||||
it "handles concurrency" do
|
it "handles concurrency" do
|
||||||
@@ -47,7 +47,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
mock(engine).watch_for_output
|
mock(engine).watch_for_output
|
||||||
mock(engine).watch_for_termination
|
mock(engine).watch_for_termination
|
||||||
mock(engine).terminate_gracefully
|
mock(engine).terminate_gracefully
|
||||||
engine.start
|
engine.run
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
File.open("/tmp/env", "w") { |f| f.puts("FOO=baz") }
|
File.open("/tmp/env", "w") { |f| f.puts("FOO=baz") }
|
||||||
engine = Foreman::Engine.new("Procfile", :env => "/tmp/env")
|
engine = Foreman::Engine.new("Procfile", :env => "/tmp/env")
|
||||||
engine.environment.should == {"FOO"=>"baz"}
|
engine.environment.should == {"FOO"=>"baz"}
|
||||||
engine.start
|
engine.run
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should read more than one if specified" do
|
it "should read more than one if specified" do
|
||||||
@@ -74,7 +74,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
File.open("/tmp/env2", "w") { |f| f.puts("BAZ=qux") }
|
File.open("/tmp/env2", "w") { |f| f.puts("BAZ=qux") }
|
||||||
engine = Foreman::Engine.new("Procfile", :env => "/tmp/env1,/tmp/env2")
|
engine = Foreman::Engine.new("Procfile", :env => "/tmp/env1,/tmp/env2")
|
||||||
engine.environment.should == { "FOO"=>"bar", "BAZ"=>"qux" }
|
engine.environment.should == { "FOO"=>"bar", "BAZ"=>"qux" }
|
||||||
engine.start
|
engine.run
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should handle quoted values" do
|
it "should handle quoted values" do
|
||||||
@@ -97,7 +97,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
File.open(".env", "w") { |f| f.puts("FOO=qoo") }
|
File.open(".env", "w") { |f| f.puts("FOO=qoo") }
|
||||||
engine = Foreman::Engine.new("Procfile")
|
engine = Foreman::Engine.new("Procfile")
|
||||||
engine.environment.should == {"FOO"=>"qoo"}
|
engine.environment.should == {"FOO"=>"qoo"}
|
||||||
engine.start
|
engine.run
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ describe "Foreman::Engine", :fakefs do
|
|||||||
stub(subject).watch_for_output
|
stub(subject).watch_for_output
|
||||||
stub(subject).watch_for_termination
|
stub(subject).watch_for_termination
|
||||||
stub(subject).terminate_gracefully
|
stub(subject).terminate_gracefully
|
||||||
subject.start
|
subject.run
|
||||||
Process.waitall
|
Process.waitall
|
||||||
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
mock(subject).info(/started with pid \d+/, "utf8.1", anything)
|
||||||
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
mock(subject).info("\xff\x03\n", "utf8.1", anything)
|
||||||
|
|||||||
Reference in new issue
Block a user