1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00

Little better test config.rb discovery checking

This commit is contained in:
Thomas Reynolds 2018-01-25 14:44:47 -08:00
parent d6f1898c1d
commit 4684c63890
3 changed files with 11 additions and 3 deletions

View file

@ -42,7 +42,9 @@ module Middleman::Cli
# Core build Thor command
# @return [void]
def build
unless ENV['MM_ROOT']
root = ENV['MM_ROOT'] || Dir.pwd
unless File.exists?(File.join(root, "config.rb"))
raise Thor::Error, 'Error: Could not find a Middleman project config, perhaps you are in the wrong folder?'
end
@ -79,7 +81,7 @@ module Middleman::Cli
::Middleman::Util.instrument 'builder.run' do
if builder.run!
clean_directories! if options['clean']
shell.say 'Project built successfully.'
puts 'Project built successfully.'
else
msg = 'There were errors during this build'
unless options['verbose']

View file

@ -41,7 +41,7 @@ Feature: Builder
Scenario: Build empty errors
Given a built app at "empty-app"
Then the exit status should be 1
Then was not successfully built
Scenario: Build external_pipeline errors
Given a built app at "external-pipeline-error"

View file

@ -19,6 +19,12 @@ Given /^was successfully built$/ do
step %Q{a directory named "build" should exist}
end
Given /^was not successfully built$/ do
step %Q{the output should not contain "Project built successfully."}
step %Q{the exit status should be 1}
step %Q{a directory named "build" should not exist}
end
Given /^a successfully built app at "([^\"]*)"$/ do |path|
step %Q{a built app at "#{path}"}
step %Q{was successfully built}