summaryrefslogtreecommitdiff
path: root/spec/dest_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-04-06 23:59:50 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-04-07 00:51:47 -0600
commit1b307776cbc471699a629ce6da52125f6274fbe2 (patch)
tree9e5d02f3717982a683c6cb74c061a59512f0f68c /spec/dest_spec.rb
parent9ebece43a66bca74d1ba0dcfe1aa4bc54116aa24 (diff)
move dest test cases to dest tests
Diffstat (limited to 'spec/dest_spec.rb')
-rw-r--r--spec/dest_spec.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/dest_spec.rb b/spec/dest_spec.rb
index 24c90c64..53d51cbf 100644
--- a/spec/dest_spec.rb
+++ b/spec/dest_spec.rb
@@ -20,6 +20,48 @@ describe 'Asciidoctor::PDF::Converter - Dest' do
(expect top_y).to eql page_height
end
+ it 'should register dest for every block that has an ID' do
+ ['', 'abstract', 'example', 'open', 'sidebar', 'quote', 'verse', 'listing', 'literal', 'NOTE'].each do |style|
+ pdf = to_pdf <<~EOS
+ [#{style}#disclaimer]
+ All views expressed are my own.
+ EOS
+
+ names = get_names pdf
+ (expect names).to have_key 'disclaimer'
+ end
+ end
+
+ it 'should register dest for unordered list that has an ID' do
+ pdf = to_pdf <<~'EOS'
+ [#takeaways]
+ * one
+ * two
+ EOS
+
+ (expect get_names pdf).to have_key 'takeaways'
+ end
+
+ it 'should register dest for ordered list that has an ID' do
+ pdf = to_pdf <<~'EOS'
+ [#takeaways]
+ . one
+ . two
+ EOS
+
+ (expect get_names pdf).to have_key 'takeaways'
+ end
+
+ it 'should register dest for description list that has an ID' do
+ pdf = to_pdf <<~'EOS'
+ [#takeaways]
+ reuse:: try to avoid binning it in the first place
+ recycle:: if you do bin it, make sure the material gets reused
+ EOS
+
+ (expect get_names pdf).to have_key 'takeaways'
+ end
+
it 'should define a dest at the location of an inline anchor' do
['[[details]]details', '[#details]#details#'].each do |details|
pdf = to_pdf <<~EOS