summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-08-19 23:59:14 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-08-20 00:31:24 -0600
commitabcff4022da739753bd76d0e5df6e4f095d71501 (patch)
treeb8a03caae66ede6a2dc840e9aa1f842e77d0c010
parent77ee4188b85402b9d41b5e0bea6b48efe01bf3a5 (diff)
verify running content is disabled if document has no body
-rw-r--r--spec/running_content_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/running_content_spec.rb b/spec/running_content_spec.rb
index 67d1f3e3..97bcc172 100644
--- a/spec/running_content_spec.rb
+++ b/spec/running_content_spec.rb
@@ -46,6 +46,17 @@ describe 'Asciidoctor::PDF::Converter - Running Content' do
(expect pdf.find_text %r/^\d+$/).to be_empty
end
+ it 'should not attempt to add running content if document has no body' do
+ pdf = to_pdf <<~'EOS', attributes: { 'nofooter' => 'nil' }, analyze: true
+ = Document Title
+ :doctype: book
+ EOS
+
+ text = pdf.text
+ (expect text).to have_size 1
+ (expect text[0][:string]).to eql 'Document Title'
+ end
+
it 'should start running content at title page if running_content_start_at key is title' do
theme_overrides = { running_content_start_at: 'title' }