test/extra/checking/checks/test_stale.rb in nanoc-3.7.4 vs test/extra/checking/checks/test_stale.rb in nanoc-3.7.5
- old
+ new
@@ -1,9 +1,8 @@
# encoding: utf-8
class Nanoc::Extra::Checking::Checks::StaleTest < Nanoc::TestCase
-
def check_class
Nanoc::Extra::Checking::Checks::Stale
end
def calc_issues
@@ -12,11 +11,11 @@
check.run
check.issues
end
def test_run_ok
- with_site do |site|
+ with_site do |_site|
assert Dir['content/*'].empty?
assert Dir['output/*'].empty?
# Empty
FileUtils.mkdir_p('output')
@@ -28,11 +27,11 @@
assert calc_issues.empty?
end
end
def test_run_error
- with_site do |site|
+ with_site do |_site|
assert Dir['content/*'].empty?
assert Dir['output/*'].empty?
File.open('content/index.html', 'w') { |io| io.write('stuff') }
File.open('output/WRONG.html', 'w') { |io| io.write('stuff') }
@@ -42,11 +41,11 @@
assert_equal 'output/WRONG.html', issue.subject
end
end
def test_run_excluded
- with_site do |site|
+ with_site do |_site|
assert Dir['content/*'].empty?
assert Dir['output/*'].empty?
File.open('nanoc.yaml', 'w') { |io| io.write "prune:\n exclude: [ 'excluded.html' ]" }
File.open('content/index.html', 'w') { |io| io.write('stuff') }
@@ -54,17 +53,16 @@
assert calc_issues.empty?
end
end
def test_run_excluded_with_broken_config
- with_site do |site|
+ with_site do |_site|
assert Dir['content/*'].empty?
assert Dir['output/*'].empty?
File.open('nanoc.yaml', 'w') { |io| io.write "prune:\n blah: meh" }
File.open('content/index.html', 'w') { |io| io.write('stuff') }
File.open('output/excluded.html', 'w') { |io| io.write('stuff') }
refute calc_issues.empty?
end
end
-
end