Skip to content

Commit 88ddbee

Browse files
committed
Add spec for #882
1 parent 2331305 commit 88ddbee

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
describe 'GH-882', site: true, stdio: true do
2+
before do
3+
File.write('content/foo.md', 'I am foo!')
4+
File.write('content/bar.md', 'I am bar!')
5+
6+
File.write('Rules', <<EOS)
7+
compile '/**/*' do
8+
write item.identifier.without_ext + '.html'
9+
end
10+
11+
postprocess do
12+
modified_reps = items.flat_map(&:modified)
13+
modified_reps.each do |rep|
14+
puts "Modified: \#{rep.item.identifier} - \#{rep.name}"
15+
end
16+
end
17+
EOS
18+
end
19+
20+
example do
21+
Nanoc::CLI.run(%w(compile))
22+
23+
File.write('content/bar.md', 'I am bar! Modified!')
24+
expect { Nanoc::CLI.run(%w(compile)) }.to output(%r{^Modified: /bar.md - default$}).to_stdout
25+
26+
File.write('content/bar.md', 'I am bar! Modified again!')
27+
expect { Nanoc::CLI.run(%w(compile)) }.not_to output(%r{^Modified: /foo.md - default$}).to_stdout
28+
end
29+
end

0 commit comments

Comments
 (0)