diff options
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 |
