Sha256: a7f7b40f6de6280992ec3610dee1eb2f9af0c20d66811fd1d71a3d4e4fcc34af

Contents?: true

Size: 773 Bytes

Versions: 22

Compression:

Stored size: 773 Bytes

Contents

describe 'GH-769', site: true do
  before do
    File.write('content/index.md', 'Index!')
    File.write('content/donkey.md', 'Donkey! [<%= @item.parent.identifier %>]')

    File.open('nanoc.yaml', 'w') do |io|
      io << 'string_pattern_type: legacy' << "\n"
      io << 'data_sources:' << "\n"
      io << '  -' << "\n"
      io << '    type: filesystem' << "\n"
      io << '    identifier_type: legacy' << "\n"
    end

    File.write('Rules', <<EOS)
  compile '*' do
    filter :erb
    write item.identifier + 'index.html'
  end

  layout '/foo.*', :erb
EOS
  end

  it 'finds the parent if the parent is root' do
    site = Nanoc::Int::SiteLoader.new.new_from_cwd
    site.compile

    expect(File.read('output/donkey/index.html')).to eql('Donkey! [/]')
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
nanoc-4.7.9 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.8 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.7 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.6 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.5 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.4 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.3 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.2 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.1 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.7.0 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.6.4 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.6.3 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.6.2 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.6.1 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.6.0 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.5.4 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.5.3 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.5.2 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.5.1 spec/nanoc/regressions/gh_769_spec.rb
nanoc-4.5.0 spec/nanoc/regressions/gh_769_spec.rb