spec/nanoc/integration/outdatedness_integration_spec.rb in nanoc-4.4.6 vs spec/nanoc/integration/outdatedness_integration_spec.rb in nanoc-4.4.7

- old
+ new

@@ -1,11 +1,16 @@ describe 'Outdatedness integration', site: true, stdio: true do context 'only attribute dependency' do + let(:time) { Time.now } + before do File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoo") File.write('content/bar.md', '<%= @items["/foo.*"][:title] %>') + FileUtils.touch('content/foo.md', mtime: time) + FileUtils.touch('content/bar.md', mtime: time) + File.write('Rules', <<EOS) compile '/foo.*' do write '/foo.html' end @@ -27,10 +32,11 @@ ) end it 'shows file as outdated after modification' do File.write('content/bar.md', 'JUST BAR!') + FileUtils.touch('content/bar.md', mtime: time) expect { Nanoc::CLI.run(%w(show-data --no-color)) }.to( output(/^item \/foo\.md, rep default:\n is not outdated/).to_stdout, ) expect { Nanoc::CLI.run(%w(show-data --no-color)) }.to( @@ -38,10 +44,11 @@ ) end it 'shows file and dependencies as not outdated after content modification' do File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoooOoooOOoooOooo") + FileUtils.touch('content/foo.md', mtime: time) expect { Nanoc::CLI.run(%w(show-data --no-color)) }.to( output(/^item \/foo\.md, rep default:\n is outdated: /).to_stdout, ) expect { Nanoc::CLI.run(%w(show-data --no-color)) }.to( @@ -49,9 +56,10 @@ ) end it 'shows file and dependencies as outdated after title modification' do File.write('content/foo.md', "---\ntitle: bye\n---\n\nfoo") + FileUtils.touch('content/foo.md', mtime: time) expect { Nanoc::CLI.run(%w(show-data --no-color)) }.to( output(/^item \/foo\.md, rep default:\n is outdated: /).to_stdout, ) expect { Nanoc::CLI.run(%w(show-data --no-color)) }.to(