Sha256: 93e3e83c2ba805e8d02117252b2a9d7e1f50c594fcdb4148bd27c2e68e078ad0

Contents?: true

Size: 1002 Bytes

Versions: 17

Compression:

Stored size: 1002 Bytes

Contents

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

17 entries across 17 versions & 1 rubygems

Version Path
nanoc-4.7.5 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.4 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.3 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.2 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.1 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.7.0 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.6.4 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.6.3 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.6.2 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.6.1 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.6.0 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.5.4 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.5.3 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.5.2 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.5.1 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.5.0 spec/nanoc/regressions/gh_1047_spec.rb
nanoc-4.4.7 spec/nanoc/regressions/gh_1047_spec.rb