Sha256: a64d6948c3d836b9ca504cc47c7e0a9b011464f3d040036411b66b8d0334faba

Contents?: true

Size: 1.01 KB

Versions: 18

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

describe 'GH-1047', site: true, stdio: true do
  before do
    File.write('Rules', <<EOS)
  compile '/*' do
    filter :erb
    write item.identifier
  end
EOS
  end

  it 'does not reuse old content' do
    File.write('content/foo.md', 'I am old foo!')
    File.write('content/bar.md', 'I am old bar!')
    Nanoc::CLI.run(%w[compile])
    expect(File.read('output/foo.md')).to eql('I am old foo!')
    expect(File.read('output/bar.md')).to eql('I am old bar!')

    File.write('content/foo.md', 'I am foo!')
    File.write('content/bar.md', '<%= @items["/foo.*"].compiled_content %><%= raise "boom" %>')
    expect { Nanoc::CLI.run(%w[compile]) }.to raise_error(Nanoc::Int::Errors::CompilationError)
    expect(File.read('output/foo.md')).to eql('I am foo!')

    File.write('content/bar.md', '[<%= @items["/foo.*"].compiled_content %>]')
    Nanoc::CLI.run(%w[compile])
    expect(File.read('output/foo.md')).to eql('I am foo!')
    expect(File.read('output/bar.md')).to eql('[I am foo!]')
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
nanoc-4.8.12 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.11 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.10 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.9 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.8 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.7 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.6 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.5 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.4 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.3 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.2 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.1 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.8.0 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.14 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.13 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.12 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.11 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.10 spec/nanoc/regressions/gh_1047_spec.rb