test/cli/commands/test_deploy.rb in nanoc-3.7.4 vs test/cli/commands/test_deploy.rb in nanoc-3.7.5
- old
+ new
@@ -1,12 +1,11 @@
# encoding: utf-8
class Nanoc::CLI::Commands::DeployTest < Nanoc::TestCase
-
def test_deploy
skip_unless_have_command 'rsync'
- with_site do |site|
+ 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'
@@ -21,11 +20,11 @@
assert File.file?('mydestination/blah.html')
end
end
def test_deploy_with_dry_run
- with_site do |site|
+ 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'
@@ -40,11 +39,11 @@
refute File.file?('mydestination/blah.html')
end
end
def test_deploy_with_list_without_config
- with_site do |site|
+ 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 )
@@ -56,11 +55,11 @@
refute File.file?('mydestination/blah.html')
end
end
def test_deploy_with_list
- with_site do |site|
+ 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'
@@ -79,11 +78,11 @@
refute File.file?('mydestination/blah.html')
end
end
def test_deploy_with_list_deployers
- with_site do |site|
+ 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'
@@ -103,11 +102,11 @@
end
end
def test_deploy_without_kind
skip_unless_have_command 'rsync'
- with_site do |site|
+ with_site do |_site|
File.open('nanoc.yaml', 'w') do |io|
io.write "deploy:\n"
io.write " public:\n"
io.write ' dst: mydestination'
end
@@ -125,32 +124,32 @@
assert File.file?('mydestination/blah.html')
end
end
def test_deploy_without_target_without_default
- with_site do |site|
+ with_site do |_site|
File.open('nanoc.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' }
- capturing_stdio do
+ capturing_stdio do
err = assert_raises Nanoc::Errors::GenericTrivial do
Nanoc::CLI.run %w( deploy )
end
assert_equal 'The site has no deployment configuration for default.', err.message
end
end
end
def test_deploy_without_target_with_default
skip_unless_have_command 'rsync'
- with_site do |site|
+ with_site do |_site|
File.open('nanoc.yaml', 'w') do |io|
io.write "deploy:\n"
io.write " default:\n"
io.write ' dst: mydestination'
end
@@ -164,7 +163,6 @@
assert File.directory?('mydestination')
assert File.file?('mydestination/blah.html')
end
end
-
end