summaryrefslogtreecommitdiff
path: root/spec/paragraph_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-02-14 23:18:40 -0700
committerDan Allen <dan.j.allen@gmail.com>2021-02-15 02:18:50 -0700
commit4750277ab83a225a62c46cb5430e2878ff9b56d7 (patch)
treec854977dc29d2fde4db3f900a3e00000722b426a /spec/paragraph_spec.rb
parente650037b1adf8c79b29c453f7d0ae7df8b491d78 (diff)
verify caption use base align (as symbol) when align key is set to inherit by theme
Diffstat (limited to 'spec/paragraph_spec.rb')
-rw-r--r--spec/paragraph_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/paragraph_spec.rb b/spec/paragraph_spec.rb
index 55dfb5ec..e84c0957 100644
--- a/spec/paragraph_spec.rb
+++ b/spec/paragraph_spec.rb
@@ -88,4 +88,17 @@ describe 'Asciidoctor::PDF::Converter - Paragraph' do
disclaimer_text = (pdf.find_text 'Disclaimer')[0]
(expect disclaimer_text[:font_name]).to eql 'NotoSerif-Italic'
end
+
+ it 'should use base align if caption align is set to inherit' do
+ pdf = to_pdf <<~'EOS', pdf_theme: { base_align: 'right', caption_align: 'inherit' }, analyze: true
+ .Title
+ Text
+ EOS
+
+ center_x = (pdf.page 1)[:size][1] * 0.5
+ title_text = pdf.find_unique_text 'Title'
+ paragraph_text = pdf.find_unique_text 'Text'
+ (expect title_text[:x]).to be > center_x
+ (expect paragraph_text[:x]).to be > center_x
+ end
end