summaryrefslogtreecommitdiff
path: root/spec/title_page_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-05-25 01:39:39 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-05-25 01:39:39 -0600
commit56776e3affea9b4b15c3f79053f7ca569602d9a2 (patch)
treeb88a50050cabe382bcdb6d209aa31a3333207144 /spec/title_page_spec.rb
parent54c6651263cec0119a5c91a0cebb813a308c07d1 (diff)
log warning if title page contents overruns the bounds of a single page
Diffstat (limited to 'spec/title_page_spec.rb')
-rw-r--r--spec/title_page_spec.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/title_page_spec.rb b/spec/title_page_spec.rb
index 1c5a9342..d812c8dc 100644
--- a/spec/title_page_spec.rb
+++ b/spec/title_page_spec.rb
@@ -1228,7 +1228,7 @@ describe 'Asciidoctor::PDF::Converter - Title Page' do
(expect title_page_images[0].data).to eql image_data
end
- it 'should restrain content of title page to a single page' do
+ it '.only should truncate contents of title page so it does not exceed the height of a single page' do
pdf_theme = {
title_page_title_top: '50%',
title_page_title_font_size: 92,
@@ -1236,16 +1236,19 @@ describe 'Asciidoctor::PDF::Converter - Title Page' do
title_page_authors_font_size: 64,
}
- pdf = to_pdf <<~'EOS', pdf_theme: pdf_theme, analyze: true
- = Document Title
- Author Name
- v1.0
- :doctype: book
+ pdf = nil
+ (expect do
+ pdf = to_pdf <<~'EOS', pdf_theme: pdf_theme, analyze: true
+ = Document Title
+ Author Name
+ v1.0
+ :doctype: book
- == First Chapter
+ == First Chapter
- content
- EOS
+ content
+ EOS
+ end).to log_message severity: :WARN, message: 'the title page contents has been truncated to prevent it from overrunning the bounds of a single page'
(expect pdf.pages).to have_size 2
author_text = pdf.find_unique_text 'Author Name'