spec/nanoc/integration/outdatedness_integration_spec.rb in nanoc-4.7.9 vs spec/nanoc/integration/outdatedness_integration_spec.rb in nanoc-4.7.10
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
describe 'Outdatedness integration', site: true, stdio: true do
context 'only attribute dependency' do
let(:time) { Time.now }
before do
@@ -7,19 +9,19 @@
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
+ File.write('Rules', <<~EOS)
+ compile '/foo.*' do
+ write '/foo.html'
+ end
-compile '/bar.*' do
- filter :erb
- write '/bar.html'
-end
+ compile '/bar.*' do
+ filter :erb
+ write '/bar.html'
+ end
EOS
end
before { Nanoc::CLI.run(%w[compile]) }
@@ -72,19 +74,19 @@
context 'only raw content dependency' do
before do
File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoo")
File.write('content/bar.md', '<%= @items["/foo.*"].raw_content %>')
- File.write('Rules', <<EOS)
-compile '/foo.*' do
- write '/foo.html'
-end
+ File.write('Rules', <<~EOS)
+ compile '/foo.*' do
+ write '/foo.html'
+ end
-compile '/bar.*' do
- filter :erb
- write '/bar.html'
-end
+ compile '/bar.*' do
+ filter :erb
+ write '/bar.html'
+ end
EOS
end
before { Nanoc::CLI.run(%w[compile]) }
@@ -134,19 +136,19 @@
context 'attribute and raw content dependency' do
before do
File.write('content/foo.md', "---\ntitle: hello\n---\n\nfoo")
File.write('content/bar.md', '<%= @items["/foo.*"].raw_content %> / <%= @items["/foo.*"][:title] %>')
- File.write('Rules', <<EOS)
-compile '/foo.*' do
- write '/foo.html'
-end
+ File.write('Rules', <<~EOS)
+ compile '/foo.*' do
+ write '/foo.html'
+ end
-compile '/bar.*' do
- filter :erb
- write '/bar.html'
-end
+ compile '/bar.*' do
+ filter :erb
+ write '/bar.html'
+ end
EOS
end
before { Nanoc::CLI.run(%w[compile]) }
@@ -191,19 +193,19 @@
output(/^item \/bar\.md, rep default:\n is outdated:/).to_stdout,
)
end
it 'shows file and dependencies as not outdated after rule modification' do
- File.write('Rules', <<EOS)
-compile '/foo.*' do
- filter :erb
- write '/foo.html'
-end
+ File.write('Rules', <<~EOS)
+ compile '/foo.*' do
+ filter :erb
+ write '/foo.html'
+ end
-compile '/bar.*' do
- filter :erb
- write '/bar.html'
-end
+ compile '/bar.*' do
+ filter :erb
+ write '/bar.html'
+ end
EOS
expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
output(/^item \/foo\.md, rep default:\n is outdated:/).to_stdout,
)