add execute command

This commit is contained in:
David Dollar
2010-06-09 11:51:18 -04:00
parent 675ad2630d
commit 3f48d7c541
3 changed files with 36 additions and 0 deletions
+21
View File
@@ -25,6 +25,27 @@ describe "Foreman::CLI" do
end
end
describe "execute" do
describe "with a non-existent Procfile" do
it "prints an error" do
mock_error(subject, "Procfile does not exist.") do
dont_allow.instance_of(Foreman::Engine).start
subject.execute("alpha")
end
end
end
describe "with a Procfile" do
before(:each) { write_procfile }
it "runs successfully" do
dont_allow(subject).error
mock.instance_of(Foreman::Engine).execute("alpha")
subject.execute("alpha")
end
end
end
describe "export" do
describe "with a non-existent Procfile" do
it "prints an error" do
+8
View File
@@ -29,4 +29,12 @@ describe "Foreman::Engine" do
subject.start
end
end
describe "execute" do
it "runs the processes" do
write_procfile
mock(subject).run(subject.processes["alpha"], false)
subject.execute("alpha")
end
end
end