Sha256: c7869ba1a316c9293edba328f8184199c5cdbaabccfb9a70a1ccae36a1a6d0fd

Contents?: true

Size: 1.53 KB

Versions: 18

Compression:

Stored size: 1.53 KB

Contents

# frozen_string_literal: true

describe 'GH-970 (show-data)', site: true, stdio: true do
  before do
    File.write('content/foo.md', 'foo')
    File.write('content/bar.md', '<%= @items["/foo.*"].compiled_content %>')

    File.write('Rules', <<~EOS)
      compile '/foo.*' do
        write '/foo.html'
      end

      compile '/bar.*' do
        filter :erb
        write '/bar.html'
      end
EOS
  end

  before { Nanoc::CLI.run(%w[compile]) }

  it 'shows default rep outdatedness' do
    expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
      output(/^item \/foo\.md, rep default:\n  is not outdated/).to_stdout,
    )
    expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
      output(/^item \/bar\.md, rep default:\n  is not outdated/).to_stdout,
    )
  end

  it 'shows file as outdated after modification' do
    File.write('content/bar.md', 'JUST BAR!')

    expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
      output(/^item \/foo\.md, rep default:\n  is not outdated/).to_stdout,
    )
    expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
      output(/^item \/bar\.md, rep default:\n  is outdated:/).to_stdout,
    )
  end

  it 'shows file and dependencies as outdated after modification' do
    File.write('content/foo.md', 'FOO!')

    expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
      output(/^item \/foo\.md, rep default:\n  is outdated:/).to_stdout,
    )
    expect { Nanoc::CLI.run(%w[show-data --no-color]) }.to(
      output(/^item \/bar\.md, rep default:\n  is outdated:/).to_stdout,
    )
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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