Sha256: 79a3964c835135da72a9587325705c60ba85a167f3ab9b727ce14ef36dc496e3
Contents?: true
Size: 1.57 KB
Versions: 10
Compression:
Stored size: 1.57 KB
Contents
require "spec_helper" require "foreman/cli" describe "Foreman::CLI" do subject { Foreman::CLI.new } describe "start" 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 end end describe "with a Procfile" do before(:each) { write_procfile } it "runs successfully" do dont_allow(subject).error mock.instance_of(Foreman::Engine).start subject.start end end end describe "export" 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 end end describe "with a Procfile" do before(:each) { write_procfile } describe "with an invalid formatter" do it "prints an error" do mock_error(subject, "Unknown export format: invalidformatter.") do subject.export("invalidformatter") end end end describe "with a valid config" do before(:each) { write_foreman_config("testapp") } it "runs successfully" do dont_allow(subject).error mock.instance_of(Foreman::Export::Upstart).export("/tmp/foo", { :concurrency => nil, :name => nil }) subject.export("upstart", "/tmp/foo") end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems