summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-08-20 00:37:22 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-08-20 00:37:22 -0600
commitc89079c488dcd6daecdf22a88970bda450a23ba0 (patch)
tree0bbc205302e25446bceb3d1722dede322d38cae7
parentabcff4022da739753bd76d0e5df6e4f095d71501 (diff)
fix toc test
-rw-r--r--spec/toc_spec.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/toc_spec.rb b/spec/toc_spec.rb
index a40b1382..b8bdd2b4 100644
--- a/spec/toc_spec.rb
+++ b/spec/toc_spec.rb
@@ -190,14 +190,18 @@ describe 'Asciidoctor::PDF::Converter - TOC' do
lines = pdf.lines pdf.find_text page_number: 2
(expect lines).to have_size 5
(expect lines[0]).to eql 'Table of Contents'
- (expect lines[1]).to start_with 'I: P1'
- (expect lines[2]).to start_with '1. C1'
- (expect lines[3]).to start_with 'II: P2'
- (expect lines[4]).to start_with '2. C2'
if asciidoctor_2_or_better?
+ (expect lines[1]).to start_with 'I: P1'
+ (expect lines[3]).to start_with 'II: P2'
(expect pdf.find_text 'Part I: P1').to have_size 1
- (expect pdf.find_text 'Chapter 1. C1').to have_size 1
+ else
+ (expect lines[1]).to start_with 'P1'
+ (expect lines[3]).to start_with 'P2'
+ (expect pdf.find_text 'P1').to have_size 2
end
+ (expect lines[2]).to start_with '1. C1'
+ (expect lines[4]).to start_with '2. C2'
+ (expect pdf.find_text 'Chapter 1. C1').to have_size 1
end
end