summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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