summaryrefslogtreecommitdiff
path: root/spec/paragraph_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-11-11 23:58:03 -0700
committerDan Allen <dan.j.allen@gmail.com>2019-11-12 01:05:28 -0700
commit0d946b9136faaaa77ad6d877027c2e5524851830 (patch)
treef726d68ba7265becc588faaeb1bb52a6947361a3 /spec/paragraph_spec.rb
parent74ecbad214accfd886d44fc6f1165f476a795c6d (diff)
use same height throughout abstract
Diffstat (limited to 'spec/paragraph_spec.rb')
-rw-r--r--spec/paragraph_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/paragraph_spec.rb b/spec/paragraph_spec.rb
index f2a3f4a8..c8b4aabc 100644
--- a/spec/paragraph_spec.rb
+++ b/spec/paragraph_spec.rb
@@ -164,4 +164,30 @@ describe 'Asciidoctor::PDF::Converter - Paragraph' do
(expect abstract_text_2).to have_size 1
(expect abstract_text_2[0][:x]).to be < halfway_point
end
+
+ it 'should apply same line height to all paragraphs in abstract' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ = Document Title
+
+ [abstract]
+ --
+ paragraph 1, line 1 +
+ paragraph 1, line 2
+
+ paragraph 2, line 1 +
+ paragraph 2, line 2
+ --
+
+ == Section
+
+ content
+ EOS
+
+ p1_l1_text = (pdf.find_text 'paragraph 1, line 1')[0]
+ p1_l2_text = (pdf.find_text 'paragraph 1, line 2')[0]
+ p2_l1_text = (pdf.find_text 'paragraph 2, line 1')[0]
+ p2_l2_text = (pdf.find_text 'paragraph 2, line 2')[0]
+
+ (expect p2_l1_text[:y] - p2_l2_text[:y]).to eql p1_l1_text[:y] - p1_l2_text[:y]
+ end
end