summaryrefslogtreecommitdiff
path: root/spec/index_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-03-04 23:54:07 -0700
committerDan Allen <dan.j.allen@gmail.com>2022-03-05 02:24:19 -0700
commita36e5afaef6bd200cdb1bfaea55ae670ad5a2d7c (patch)
treeb32e6453bc0df4ddce096dfb61a10e1874ea4d99 /spec/index_spec.rb
parent1bec943dfad7260555b1c6079fe3d5fac4574af6 (diff)
add helper to retrieve metadata for destination
Diffstat (limited to 'spec/index_spec.rb')
-rw-r--r--spec/index_spec.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/index_spec.rb b/spec/index_spec.rb
index a67205ee..cf6d9028 100644
--- a/spec/index_spec.rb
+++ b/spec/index_spec.rb
@@ -158,12 +158,10 @@ describe 'Asciidoctor::PDF::Converter - Index' do
pdf = to_pdf input
annotations = get_annotations pdf, 3
(expect annotations).to have_size 1
- dest = annotations[0][:Dest]
- names = get_names pdf
- (expect names).to have_key dest
- (expect pdf.objects[names[dest]][2]).to eql dogs_text[:x]
- term_pgnum = get_page_number pdf, pdf.objects[pdf.objects[names[dest]][0]]
- (expect term_pgnum).to be 2
+ dest_name = annotations[0][:Dest]
+ (expect (dest = get_dest pdf, dest_name)).not_to be_nil
+ (expect dest[:x]).to eql dogs_text[:x]
+ (expect dest[:page_number]).to be 2
end
it 'should target first occurance of index term, not in xreftext' do