summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-10-09 00:35:59 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-10-09 00:35:59 -0600
commit7ffa5019f62ff1cc1460d89f95224fd80edcd0f5 (patch)
tree7f1d317d3988706247236122a9ad1704c236d990 /spec
parentceb0f07b03f9060be2ecce839d9c02c53a693a89 (diff)
add test to verify border on quote block doesn't spill to next page
Diffstat (limited to 'spec')
-rw-r--r--spec/quote_spec.rb28
-rw-r--r--spec/verse_spec.rb4
2 files changed, 28 insertions, 4 deletions
diff --git a/spec/quote_spec.rb b/spec/quote_spec.rb
index daa52a05..9b4aa1f5 100644
--- a/spec/quote_spec.rb
+++ b/spec/quote_spec.rb
@@ -2,7 +2,7 @@ require_relative 'spec_helper'
describe 'Asciidoctor::PDF::Converter - Quote' do
it 'should show caption above block if title is specified' do
- pdf = to_pdf <<~EOS, analyze: true
+ pdf = to_pdf <<~'EOS', analyze: true
.Words of wisdom
____
Let it be.
@@ -16,7 +16,7 @@ describe 'Asciidoctor::PDF::Converter - Quote' do
end
it 'should not draw left border if border_width is 0' do
- pdf = to_pdf <<~EOS, pdf_theme: { blockquote_border_width: 0 }, analyze: :line
+ pdf = to_pdf <<~'EOS', pdf_theme: { blockquote_border_width: 0 }, analyze: :line
____
Let it be.
____
@@ -24,4 +24,28 @@ describe 'Asciidoctor::PDF::Converter - Quote' do
(expect pdf.lines).to be_empty
end
+
+ it 'should not draw left border on next page if block falls at bottom of page' do
+ pdf_theme = {
+ thematic_break_border_color: 'DDDDDD',
+ thematic_break_margin_bottom: 669.75,
+ }
+ pdf = to_pdf <<~EOS, pdf_theme: pdf_theme, analyze: :line
+ filler
+
+ ---
+
+ ____
+ Let it be.
+
+ Let it be.
+ ____
+
+ Words of wisdom were spoken.
+ EOS
+
+ quote_borders = pdf.lines.select {|it| it[:color] == 'EEEEEE' }
+ (expect quote_borders).to have_size 1
+ (expect quote_borders[0][:page_number]).to eql 1
+ end
end
diff --git a/spec/verse_spec.rb b/spec/verse_spec.rb
index bd94289d..b8715192 100644
--- a/spec/verse_spec.rb
+++ b/spec/verse_spec.rb
@@ -2,7 +2,7 @@ require_relative 'spec_helper'
describe 'Asciidoctor::PDF::Converter - Verse' do
it 'should show caption above block if title is specified' do
- pdf = to_pdf <<~EOS, analyze: true
+ pdf = to_pdf <<~'EOS', analyze: true
.Fog
[verse]
____
@@ -35,7 +35,7 @@ describe 'Asciidoctor::PDF::Converter - Verse' do
end
it 'should not draw left border if border_width is 0' do
- pdf = to_pdf <<~EOS, pdf_theme: { blockquote_border_width: 0 }, analyze: :line
+ pdf = to_pdf <<~'EOS', pdf_theme: { blockquote_border_width: 0 }, analyze: :line
____
here
we