Provide a useful error if foreman check fails to find a Procfile

Fixes #152
This commit is contained in:
R. Tyler Croy
2012-02-21 17:27:15 -08:00
parent 7e55d8d3e2
commit c23dbb79af
2 changed files with 9 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ class Foreman::CLI < Thor
desc "check", "Validate your application's Procfile"
def check
check_procfile!
error "no processes defined" unless engine.procfile.entries.length > 0
puts "valid procfile detected (#{engine.procfile.process_names.join(', ')})"
end

View File

@@ -120,6 +120,14 @@ describe "Foreman::CLI", :fakefs do
end
end
end
describe "without a Procfile" do
it "displays an error" do
mock_error(subject, "Procfile does not exist.") do
subject.check
end
end
end
end
describe "run" do