spec/foreman/cli_spec.rb in foreman-0.1.1 vs spec/foreman/cli_spec.rb in foreman-0.2.0
- old
+ new
@@ -3,13 +3,11 @@
describe "Foreman::CLI" do
subject { Foreman::CLI.new }
describe "start" do
- #let(:engine) { stub_engine }
-
- describe "with a non-existent Procifile" 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.start
end
@@ -25,11 +23,32 @@
subject.start
end
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 Procifile" 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).export
subject.export("testapp")
end