test/tasks/test_clean.rb in nanoc-3.7.3 vs test/tasks/test_clean.rb in nanoc-3.7.4
- old
+ new
@@ -3,18 +3,18 @@
class Nanoc::Tasks::CleanTest < Nanoc::TestCase
def test_simple
if_have 'w3c_validators' do
# Stub items
- items = [ mock, mock ]
- reps = [ [ mock, mock ], [ mock, mock ] ]
+ items = [mock, mock]
+ reps = [[mock, mock], [mock, mock]]
items[0].expects(:reps).returns(reps[0])
items[1].expects(:reps).returns(reps[1])
# Create sample files
- [ 0, 1 ].each do |item_id|
- [ 0, 1 ].each do |rep_id|
+ [0, 1].each do |item_id|
+ [0, 1].each do |rep_id|
filename = "item-#{item_id}-rep-#{rep_id}.txt"
reps[item_id][rep_id].expects(:raw_path).returns(filename)
File.open(filename, 'w') { |io| io.write('hello') }
assert File.file?(filename)
end
@@ -29,12 +29,12 @@
# Run
clean.run
# Check
- [ 0, 1 ].each do |item_id|
- [ 0, 1 ].each do |rep_id|
+ [0, 1].each do |item_id|
+ [0, 1].each do |rep_id|
filename = "item-#{item_id}-rep-#{rep_id}.txt"
assert !File.file?(filename)
end
end
end
@@ -43,17 +43,17 @@
def test_with_nil_raw_path
if_have 'w3c_validators' do
# Stub items
item = mock
rep = mock
- item.expects(:reps).returns([ rep ])
+ item.expects(:reps).returns([rep])
# Create sample file
rep.expects(:raw_path).returns(nil)
# Stub site
site = mock
- site.expects(:items).returns([ item ])
+ site.expects(:items).returns([item])
# Create clean task
clean = ::Nanoc::Tasks::Clean.new(site)
# Run