test/cli/commands/test_deploy.rb in nanoc-3.3.7 vs test/cli/commands/test_deploy.rb in nanoc-3.4.0
- old
+ new
@@ -93,6 +93,51 @@
assert File.file?('mydestination/blah.html')
end
end
end
+ def test_deploy_without_target_without_default
+ if_have 'systemu' do
+ with_site do |site|
+ File.open('config.yaml', 'w') do |io|
+ io.write "deploy:\n"
+ io.write " public:\n"
+ io.write " dst: mydestination"
+ end
+
+ FileUtils.mkdir_p('output')
+ File.open('output/blah.html', 'w') { |io| io.write 'moo' }
+
+ ios = capturing_stdio do
+ assert_raises SystemExit do
+ Nanoc::CLI.run %w( deploy )
+ end
+ end
+
+ assert ios[:stderr].include?('The site configuration has no deploy configuration for default.')
+ end
+ end
+ end
+
+ def test_deploy_without_target_without_default
+ if_have 'systemu' do
+ with_site do |site|
+ File.open('config.yaml', 'w') do |io|
+ io.write "deploy:\n"
+ io.write " default:\n"
+ io.write " dst: mydestination"
+ end
+
+ FileUtils.mkdir_p('output')
+ File.open('output/blah.html', 'w') { |io| io.write 'moo' }
+
+ ios = capturing_stdio do
+ Nanoc::CLI.run %w( deploy )
+ end
+
+ assert File.directory?('mydestination')
+ assert File.file?('mydestination/blah.html')
+ end
+ end
+ end
+
end