spec/nanoc/regressions/gh_954_spec.rb in nanoc-4.7.9 vs spec/nanoc/regressions/gh_954_spec.rb in nanoc-4.7.10
- old
+ new
@@ -1,24 +1,26 @@
+# frozen_string_literal: true
+
describe 'GH-954', site: true, stdio: true do
before do
File.write('content/foo.md', 'foo <a href="/">root</a>')
File.write('content/bar.md', 'bar <a href="/">root</a>')
File.write('content/bar-copy.md', '<%= @items["/bar.*"].compiled_content(snapshot: :last) %>')
- File.write('Rules', <<EOS)
-compile '/foo.*' do
- filter :relativize_paths, type: :html unless rep.path.nil?
- write item.identifier.without_ext + '.html'
-end
+ File.write('Rules', <<~EOS)
+ compile '/foo.*' do
+ filter :relativize_paths, type: :html unless rep.path.nil?
+ write item.identifier.without_ext + '.html'
+ end
-compile '/bar.*' do
- filter :relativize_paths, type: :html unless rep.path.nil?
-end
+ compile '/bar.*' do
+ filter :relativize_paths, type: :html unless rep.path.nil?
+ end
-compile '/bar-copy.*' do
- filter :erb
- write item.identifier.without_ext + '.html'
-end
+ compile '/bar-copy.*' do
+ filter :erb
+ write item.identifier.without_ext + '.html'
+ end
EOS
end
it 'properly filters foo.md' do
Nanoc::CLI.run(%w[compile])