summaryrefslogtreecommitdiff
path: root/spec/xref_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-10-08 23:50:36 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-10-08 23:50:36 -0600
commit088fc0af4cd1e6488cc7b00b7d5b95ebff92c4cc (patch)
tree92e5bc61c4e79bb84f49997ae1a43b22b9d7c249 /spec/xref_spec.rb
parent6a38339df98db17dd577646b488ff0d1e242ff84 (diff)
verify xrefstyle is honored when making reference to image
Diffstat (limited to 'spec/xref_spec.rb')
-rw-r--r--spec/xref_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/xref_spec.rb b/spec/xref_spec.rb
index 3030da3d..d3bb8677 100644
--- a/spec/xref_spec.rb
+++ b/spec/xref_spec.rb
@@ -247,6 +247,32 @@ describe 'Asciidoctor::PDF::Converter - Xref' do
(expect pdf.lines).to include 'Start with Chapter 1, A.'
end if asciidoctor_1_5_7_or_better?
+ it 'should refer to image with title by title by default' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ See <<img>>.
+
+ .Title of Image
+ [#img]
+ image::tux.png[]
+ EOS
+
+ (expect pdf.lines[0]).to eql 'See Title of Image.'
+ end if asciidoctor_1_5_7_or_better?
+
+ it 'should refer to image with title by reference signifier, number, and title when xrefstyle is full' do
+ pdf = to_pdf <<~'EOS', analyze: true
+ :xrefstyle: full
+
+ See <<img>>.
+
+ .Title of Image
+ [#img]
+ image::tux.png[]
+ EOS
+
+ (expect pdf.lines[0]).to eql 'See Figure 1, “Title of Image”.'
+ end if asciidoctor_1_5_7_or_better?
+
it 'should refer to image with title by reference signifier and number when xrefstyle is short' do
pdf = to_pdf <<~'EOS', analyze: true
:xrefstyle: short