File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments