change to Pstypes
This commit is contained in:
@@ -5,17 +5,17 @@ describe "Foreman::CLI" do
|
||||
subject { Foreman::CLI.new }
|
||||
|
||||
describe "start" do
|
||||
describe "with a non-existent Procfile" do
|
||||
describe "with a non-existent Pstypes" do
|
||||
it "prints an error" do
|
||||
mock_error(subject, "Procfile does not exist.") do
|
||||
mock_error(subject, "Pstypes does not exist.") do
|
||||
dont_allow.instance_of(Foreman::Engine).start
|
||||
subject.start
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "with a Procfile" do
|
||||
before(:each) { write_procfile }
|
||||
describe "with a Pstypes" do
|
||||
before(:each) { write_pstypes }
|
||||
|
||||
it "runs successfully" do
|
||||
dont_allow(subject).error
|
||||
@@ -26,17 +26,17 @@ describe "Foreman::CLI" do
|
||||
end
|
||||
|
||||
describe "export" do
|
||||
describe "with a non-existent Procfile" do
|
||||
describe "with a non-existent Pstypes" do
|
||||
it "prints an error" do
|
||||
mock_error(subject, "Procfile does not exist.") do
|
||||
mock_error(subject, "Pstypes does not exist.") do
|
||||
dont_allow.instance_of(Foreman::Engine).export
|
||||
subject.export("testapp")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "with a Procfile" do
|
||||
before(:each) { write_procfile }
|
||||
describe "with a Pstypes" do
|
||||
before(:each) { write_pstypes }
|
||||
|
||||
describe "with an invalid formatter" do
|
||||
it "prints an error" do
|
||||
|
||||
@@ -2,18 +2,18 @@ require "spec_helper"
|
||||
require "foreman/engine"
|
||||
|
||||
describe "Foreman::Engine" do
|
||||
subject { Foreman::Engine.new("Procfile") }
|
||||
subject { Foreman::Engine.new("Pstypes") }
|
||||
|
||||
describe "initialize" do
|
||||
describe "without an existing Procfile" do
|
||||
describe "without an existing Pstypes" do
|
||||
it "raises an error" do
|
||||
lambda { subject }.should raise_error
|
||||
end
|
||||
end
|
||||
|
||||
describe "with a Procfile" do
|
||||
describe "with a Pstypes" do
|
||||
it "reads the processes" do
|
||||
write_procfile
|
||||
write_pstypes
|
||||
subject.processes["alpha"].command.should == "./alpha"
|
||||
subject.processes["bravo"].command.should == "./bravo"
|
||||
end
|
||||
@@ -22,7 +22,7 @@ describe "Foreman::Engine" do
|
||||
|
||||
describe "start" do
|
||||
it "forks the processes" do
|
||||
write_procfile
|
||||
write_pstypes
|
||||
mock(subject).fork(subject.processes["alpha"], {})
|
||||
mock(subject).fork(subject.processes["bravo"], {})
|
||||
mock(subject).watch_for_termination
|
||||
@@ -30,7 +30,7 @@ describe "Foreman::Engine" do
|
||||
end
|
||||
|
||||
it "handles concurrency" do
|
||||
write_procfile
|
||||
write_pstypes
|
||||
mock(subject).fork_individual(subject.processes["alpha"], 5000)
|
||||
mock(subject).fork_individual(subject.processes["alpha"], 5001)
|
||||
mock(subject).fork_individual(subject.processes["bravo"], 5100)
|
||||
@@ -41,7 +41,7 @@ describe "Foreman::Engine" do
|
||||
|
||||
describe "execute" do
|
||||
it "runs the processes" do
|
||||
write_procfile
|
||||
write_pstypes
|
||||
mock(subject).fork(subject.processes["alpha"], {})
|
||||
mock(subject).watch_for_termination
|
||||
subject.execute("alpha")
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ def write_foreman_config(app)
|
||||
end
|
||||
end
|
||||
|
||||
def write_procfile(procfile="Procfile")
|
||||
File.open(procfile, "w") do |file|
|
||||
def write_pstypes(pstypes="Pstypes")
|
||||
File.open(pstypes, "w") do |file|
|
||||
file.puts "alpha ./alpha"
|
||||
file.puts "bravo ./bravo"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user