test/cli/commands/test_deploy.rb in nanoc-3.6.1 vs test/cli/commands/test_deploy.rb in nanoc-3.6.2

- old
+ new

@@ -1,11 +1,9 @@ # encoding: utf-8 -class Nanoc::CLI::Commands::DeployTest < MiniTest::Unit::TestCase +class Nanoc::CLI::Commands::DeployTest < Nanoc::TestCase - include Nanoc::TestHelpers - def test_deploy if_have 'systemu' do with_site do |site| File.open('nanoc.yaml', 'w') do |io| io.write "deploy:\n" @@ -44,10 +42,28 @@ refute File.file?('mydestination/blah.html') end end end + def test_deploy_with_list_without_config + if_have 'systemu' do + with_site do |site| + FileUtils.mkdir_p('output') + File.open('output/blah.html', 'w') { |io| io.write 'moo' } + + ios = capturing_stdio do + Nanoc::CLI.run %w( deploy -L ) + end + + assert ios[:stdout].include?('No deployment configurations.') + + refute File.directory?('mydestination') + refute File.file?('mydestination/blah.html') + end + end + end + def test_deploy_with_list if_have 'systemu' do with_site do |site| File.open('nanoc.yaml', 'w') do |io| io.write "deploy:\n" @@ -69,10 +85,35 @@ refute File.file?('mydestination/blah.html') end end end + def test_deploy_with_list_deployers + if_have 'systemu' do + with_site do |site| + File.open('nanoc.yaml', 'w') do |io| + io.write "deploy:\n" + io.write " public:\n" + io.write " kind: rsync\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 -D ) + end + + assert ios[:stdout].include?('Available deployers:') + + refute File.directory?('mydestination') + refute File.file?('mydestination/blah.html') + end + end + end + def test_deploy_without_kind if_have 'systemu' do with_site do |site| File.open('nanoc.yaml', 'w') do |io| io.write "deploy:\n" @@ -109,10 +150,10 @@ capturing_stdio do err = assert_raises Nanoc::Errors::GenericTrivial do Nanoc::CLI.run %w( deploy ) end - assert_equal 'The site configuration has no deploy configuration for default.', err.message + assert_equal 'The site has no deployment configuration for default.', err.message end end end end