Sha256: 4ffc22214092f9e2ea322aec41f2105eb1ac5e7935edd940bc90989e0bb109ba

Contents?: true

Size: 648 Bytes

Versions: 4

Compression:

Stored size: 648 Bytes

Contents

describe 'GH-885', site: true, stdio: true do
  before do
    File.write(
      'content/index.html',
      "<%= @items['/hello.*'].compiled_content %> - <%= Time.now.to_f %>",
    )

    File.write('Rules', <<EOS)
  preprocess do
    items.create('hi!', {}, '/hello.html')
  end

  compile '/**/*' do
    filter :erb
    write item.identifier.without_ext + '.html'
  end
EOS
  end

  example do
    Nanoc::CLI.run(%w[compile])
    before = File.read('output/index.html')

    sleep(0.1)
    Nanoc::CLI.run(%w[compile])
    after = File.read('output/index.html')
    expect(after).to eql(before)
    expect(after).to match(/\Ahi! - \d+/)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc-4.7.9 spec/nanoc/regressions/gh_885_spec.rb
nanoc-4.7.8 spec/nanoc/regressions/gh_885_spec.rb
nanoc-4.7.7 spec/nanoc/regressions/gh_885_spec.rb
nanoc-4.7.6 spec/nanoc/regressions/gh_885_spec.rb