diff options
Diffstat (limited to 'spec/section_spec.rb')
| -rw-r--r-- | spec/section_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb index a6d8a7f5..c338aeb8 100644 --- a/spec/section_spec.rb +++ b/spec/section_spec.rb @@ -713,6 +713,41 @@ describe 'Asciidoctor::PDF::Converter - Section' do (expect appendix_text[:page_number]).to be 4 end + it 'should not output section title for special section marked with untitled option' do + pdf = to_pdf <<~'EOS', pdf_theme: { heading_h2_font_color: 'AA0000' }, analyze: true + = Document Title + :doctype: book + + [colophon%untitled] + = Hide Me + + Colophon with no title. + + = Part + + == Chapter + + content + + [appendix] + = Details + + We let you know. + EOS + + colophon_page_text = pdf.find_text page_number: 2 + (expect colophon_page_text).to have_size 1 + (expect colophon_page_text[0][:string]).to eql 'Colophon with no title.' + chapter_texts = pdf.find_text font_color: 'AA0000' + (expect chapter_texts).to have_size 2 + chapter_text = chapter_texts[0] + (expect chapter_text[:string]).to eql 'Chapter' + (expect chapter_text[:page_number]).to be 4 + appendix_text = chapter_texts[1] + (expect appendix_text[:string]).to eql 'Appendix A: Details' + (expect appendix_text[:page_number]).to be 5 + end + it 'should not promote anonymous preface in book doctype to preface section if preface-title attribute is not set' do input = <<~'EOS' = Book Title |
