diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-10-27 03:21:51 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-27 03:21:51 -0600 |
| commit | 18345df420311b9a8d00c30a3d3aede21e189d3e (patch) | |
| tree | 8571de0fbfb72cb9a2bab11a91a9a90d72ea2fe9 /spec | |
| parent | 6e7340348914f622607c9bf829c18f91e3313dca (diff) | |
resolves #2363 replace use of AbstractBlock#role= method to ensure compatbility with Asciidoctor 2.0.10 (PR #2364)
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/footnote_spec.rb | 44 | ||||
| -rw-r--r-- | spec/section_spec.rb | 2 | ||||
| -rw-r--r-- | spec/source_spec.rb | 4 |
3 files changed, 35 insertions, 15 deletions
diff --git a/spec/footnote_spec.rb b/spec/footnote_spec.rb index ac5f5139..4e959055 100644 --- a/spec/footnote_spec.rb +++ b/spec/footnote_spec.rb @@ -258,14 +258,24 @@ describe 'Asciidoctor::PDF::Converter - Footnote' do Another audacious statement.{fn-disclaimer} EOS - expected_lines = <<~'EOS'.lines.map(&:chomp) - A bold statement.[1] - Another audacious statement.[1] - 1. Opinions are my own. - EOS + if (Gem::Version.new Asciidoctor::VERSION) < (Gem::Version.new '2.0.11') + expected_lines = <<~'EOS'.lines.map(&:chomp) + A bold statement.[1] + Another audacious statement.[2] + 1. Opinions are my own. + 2. Opinions are my own. + EOS + footnote_text = (pdf.find_text %r/Opinions/)[-1] + else + expected_lines = <<~'EOS'.lines.map(&:chomp) + A bold statement.[1] + Another audacious statement.[1] + 1. Opinions are my own. + EOS + footnote_text = pdf.find_unique_text %r/Opinions/ + end (expect pdf.lines).to eql expected_lines - footnote_text = pdf.find_unique_text %r/Opinions/ (expect footnote_text[:y]).to be < 60 end @@ -346,14 +356,24 @@ describe 'Asciidoctor::PDF::Converter - Footnote' do You can download patches from the product page.{fn-disclaimer} EOS - expected_lines = <<~'EOS'.lines.map(&:chomp) - You will receive notifications of all product updates.[1] - You can download patches from the product page.[1] - 1. Only available if you have an active subscription. - EOS + if (Gem::Version.new Asciidoctor::VERSION) < (Gem::Version.new '2.0.11') + expected_lines = <<~'EOS'.lines.map(&:chomp) + You will receive notifications of all product updates.[1] + You can download patches from the product page.[2] + 1. Only available if you have an active subscription. + 2. Only available if you have an active subscription. + EOS + active_text = (pdf.find_text 'active')[-1] + else + expected_lines = <<~'EOS'.lines.map(&:chomp) + You will receive notifications of all product updates.[1] + You can download patches from the product page.[1] + 1. Only available if you have an active subscription. + EOS + active_text = pdf.find_unique_text 'active' + end (expect pdf.lines).to eql expected_lines - active_text = pdf.find_unique_text 'active' (expect active_text[:font_name]).to eql 'NotoSerif-Italic' end diff --git a/spec/section_spec.rb b/spec/section_spec.rb index 1cb192b4..6df058f8 100644 --- a/spec/section_spec.rb +++ b/spec/section_spec.rb @@ -1087,7 +1087,7 @@ describe 'Asciidoctor::PDF::Converter - Section' do pdf = to_pdf input, analyze: true (expect pdf.find_unique_text 'Preface', page_number: 2).not_to be_nil (expect pdf.find_unique_text 'Preface', page_number: 3).to be_nil - # NOTE: lead role on first paragraph is retained + # NOTE: test that lead role on first paragraph is retained (expect (pdf.find_unique_text 'anonymous preface', page_number: 3)[:font_size]).to eql 13 end diff --git a/spec/source_spec.rb b/spec/source_spec.rb index 22cf7a42..9fbce6b5 100644 --- a/spec/source_spec.rb +++ b/spec/source_spec.rb @@ -1032,14 +1032,14 @@ describe 'Asciidoctor::PDF::Converter - Source' do [,ruby,subs="+quotes,+macros"] ---- - require 'https://asciidoctor.org[asciidoctor]' + require %(https://asciidoctor.org[asciidoctor]) Asciidoctor._convert_file_ 'README.adoc', *safe: :safe* ---- EOS lines = pdf.lines pdf.text - (expect lines).to eql [%(require 'asciidoctor'), %(Asciidoctor.convert_file 'README.adoc', safe: :safe)] + (expect lines).to eql ['require %(asciidoctor)', %(Asciidoctor.convert_file 'README.adoc', safe: :safe)] require_text = pdf.find_unique_text 'require' (expect require_text[:font_color]).not_to eql '333333' end |
