summaryrefslogtreecommitdiff
path: root/spec/admonition_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-04-30 03:52:53 -0600
committerGitHub <noreply@github.com>2022-04-30 03:52:53 -0600
commit2668e7320ac10fbaa73d6c6d2cff65341635d61c (patch)
tree25b88e4923d5b3c674c9119e97b410762ecdb800 /spec/admonition_spec.rb
parent0123018e84e7eea3224614d32d3e25406bcc3209 (diff)
resolves #2104 support 2 and 3-value array for padding on block (PR #2106)
Diffstat (limited to 'spec/admonition_spec.rb')
-rw-r--r--spec/admonition_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/admonition_spec.rb b/spec/admonition_spec.rb
index 131df699..a6bed1b5 100644
--- a/spec/admonition_spec.rb
+++ b/spec/admonition_spec.rb
@@ -247,6 +247,24 @@ describe 'Asciidoctor::PDF::Converter - Admonition' do
(expect (content_text[:x] - ref_content_text[:x]).round 4).to eql 30.0
end
+ it 'should allow padding to be specified for label and content using array value' do
+ input = <<~'EOS'
+ [IMPORTANT]
+ Make sure the device is powered off before servicing it.
+ EOS
+
+ pdf = to_pdf input, pdf_theme: { admonition_padding: 0, admonition_label_padding: 0 }, analyze: true
+ ref_label_text = pdf.find_unique_text 'IMPORTANT'
+ ref_content_text = pdf.find_unique_text 'Make sure the device is powered off before servicing it.'
+
+ pdf = to_pdf input, pdf_theme: { admonition_padding: [nil, 10], admonition_label_padding: [nil, 10] }, analyze: true
+ label_text = pdf.find_unique_text 'IMPORTANT'
+ content_text = pdf.find_unique_text 'Make sure the device is powered off before servicing it.'
+
+ (expect (label_text[:x] - ref_label_text[:x]).round 4).to eql 10.0
+ (expect (content_text[:x] - ref_content_text[:x]).round 4).to eql 30.0
+ end
+
it 'should not move cursor below block if block ends at top of page' do
pdf = to_pdf <<~'EOS', analyze: true
top of page