diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2020-02-18 23:57:45 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2020-02-19 00:20:18 -0700 |
| commit | 1a1cc0d093bb1919124bfa0d9d4f091230cb0297 (patch) | |
| tree | 73c20f20aaf0aa69c19068dbdb7fafa4084a6ba5 /spec/index_spec.rb | |
| parent | 611e20031d92ec4783056f8139031cf410719ffa (diff) | |
don't render index section if index is empty
Diffstat (limited to 'spec/index_spec.rb')
| -rw-r--r-- | spec/index_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/index_spec.rb b/spec/index_spec.rb index 1258d79f..f1b36b33 100644 --- a/spec/index_spec.rb +++ b/spec/index_spec.rb @@ -11,6 +11,20 @@ describe 'Asciidoctor::PDF::Converter - Index' do (expect pdf.find_text 'visible index entry').to be_empty end + it 'should not add index section if there are no index entries' do + pdf = to_pdf <<~'EOS', analyze: true + == About + + This document has no index entries. + + [index] + == Index + EOS + + (expect pdf.pages).to have_size 1 + (expect pdf.find_text 'Index').to be_empty + end + it 'should add the index entries to the section with the index style' do pdf = to_pdf <<~'EOS', doctype: :book, analyze: true = Document Title |
