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:
parent
d6f1898c1d
commit
4684c63890
3 changed files with 11 additions and 3 deletions
|
@ -42,7 +42,9 @@ module Middleman::Cli
|
||||||
# Core build Thor command
|
# Core build Thor command
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def build
|
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?'
|
raise Thor::Error, 'Error: Could not find a Middleman project config, perhaps you are in the wrong folder?'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -79,7 +81,7 @@ module Middleman::Cli
|
||||||
::Middleman::Util.instrument 'builder.run' do
|
::Middleman::Util.instrument 'builder.run' do
|
||||||
if builder.run!
|
if builder.run!
|
||||||
clean_directories! if options['clean']
|
clean_directories! if options['clean']
|
||||||
shell.say 'Project built successfully.'
|
puts 'Project built successfully.'
|
||||||
else
|
else
|
||||||
msg = 'There were errors during this build'
|
msg = 'There were errors during this build'
|
||||||
unless options['verbose']
|
unless options['verbose']
|
||||||
|
|
|
@ -41,7 +41,7 @@ Feature: Builder
|
||||||
|
|
||||||
Scenario: Build empty errors
|
Scenario: Build empty errors
|
||||||
Given a built app at "empty-app"
|
Given a built app at "empty-app"
|
||||||
Then the exit status should be 1
|
Then was not successfully built
|
||||||
|
|
||||||
Scenario: Build external_pipeline errors
|
Scenario: Build external_pipeline errors
|
||||||
Given a built app at "external-pipeline-error"
|
Given a built app at "external-pipeline-error"
|
||||||
|
|
|
@ -19,6 +19,12 @@ Given /^was successfully built$/ do
|
||||||
step %Q{a directory named "build" should exist}
|
step %Q{a directory named "build" should exist}
|
||||||
end
|
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|
|
Given /^a successfully built app at "([^\"]*)"$/ do |path|
|
||||||
step %Q{a built app at "#{path}"}
|
step %Q{a built app at "#{path}"}
|
||||||
step %Q{was successfully built}
|
step %Q{was successfully built}
|
||||||
|
|
Loading…
Reference in a new issue