deprecate colon-less syntax, add check command

This commit is contained in:
David Dollar
2011-01-27 16:14:43 -08:00
parent 977c80ffdd
commit 6b7d5e5161
9 changed files with 73 additions and 6 deletions
+23
View File
@@ -58,4 +58,27 @@ describe "Foreman::CLI" do
end
end
describe "check" do
describe "with a valid Procfile" do
before { write_procfile }
it "displays the jobs" do
mock(subject).display("valid procfile detected (alpha, bravo)")
subject.check
end
end
describe "with a blank Procfile" do
before do
FileUtils.touch("Procfile")
end
it "displays an error" do
mock_error(subject, "no processes defined") do
subject.check
end
end
end
end
end
+15 -1
View File
@@ -12,12 +12,26 @@ describe "Foreman::Engine" do
end
describe "with a Procfile" do
before { write_procfile }
it "reads the processes" do
write_procfile
subject.processes["alpha"].command.should == "./alpha"
subject.processes["bravo"].command.should == "./bravo"
end
end
describe "with a deprecated Procfile" do
before do
File.open("Procfile", "w") do |file|
file.puts "name command"
end
end
it "should print a deprecation warning" do
mock(subject).warn_deprecated_procfile!
subject.processes.length.should == 1
end
end
end
describe "start" do
+1 -1
View File
@@ -26,7 +26,7 @@ end
def write_procfile(procfile="Procfile")
File.open(procfile, "w") do |file|
file.puts "alpha ./alpha"
file.puts "alpha: ./alpha"
file.puts "bravo: ./bravo"
end
end