summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 84f48426..9992580f 100644
--- a/spec/admonition_spec.rb
+++ b/spec/admonition_spec.rb
@@ -118,6 +118,24 @@ describe 'Asciidoctor::PDF::Converter - Admonition' do
(expect pdf.find_unique_text 'IMPORTANT').to be_nil
end
+ it 'should allow padding to be specified for label and content using single 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: 10, admonition_label_padding: 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]).to eql 10.0
+ (expect content_text[:x] - ref_content_text[:x]).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