diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2024-01-07 18:28:56 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-07 18:28:56 +0300 |
| commit | ba986531f5b51c5c2b72f5e2e89f47dfbacca431 (patch) | |
| tree | 5b38149a36bfcf96c0f993cfb64fc71ea512141c /spec | |
| parent | 3e7fb05a39fa73c77da1f98a0d5aa3199cd62aa6 (diff) | |
remove compatibility code for pre-2.0 Asciidoctor (#456)
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/highlight_spec.rb | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/spec/highlight_spec.rb b/spec/highlight_spec.rb index 2282fde..0f206c1 100644 --- a/spec/highlight_spec.rb +++ b/spec/highlight_spec.rb @@ -7,32 +7,21 @@ describe 'Asciidoctor::Epub3::Converter - Highlight' do book, = to_epub fixture_file('source_highlight.adoc'), attributes: { 'source-highlighter' => 'coderay' } article = book.item_by_href 'source_highlight.xhtml' expect(article).not_to be_nil - if Asciidoctor::Document.supports_syntax_highlighter? - expect(article.content).to include '<span class="keyword">class</span> <span class="class">Foo</span>' - expect(article.content).to include '<link rel="stylesheet" href="./coderay-asciidoctor.css"/>' - expect(book.item_by_href('coderay-asciidoctor.css')).not_to be_nil - else - expect(article.content).to include '<span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Foo</span>' - end + expect(article.content).to include '<span class="keyword">class</span> <span class="class">Foo</span>' + expect(article.content).to include '<link rel="stylesheet" href="./coderay-asciidoctor.css"/>' + expect(book.item_by_href('coderay-asciidoctor.css')).not_to be_nil end it 'highlights code listings with pygments.rb' do book, = to_epub fixture_file('source_highlight.adoc'), attributes: { 'source-highlighter' => 'pygments' } article = book.item_by_href 'source_highlight.xhtml' expect(article).not_to be_nil - if Asciidoctor::Document.supports_syntax_highlighter? - expect(article.content).to include '<span class="tok-nc">Foo</span>' - expect(article.content).to include '<link rel="stylesheet" href="./pygments-bw.css"/>' - expect(book.item_by_href('pygments-bw.css')).not_to be_nil - else - expect(article.content).to include '<span style="font-weight: bold">class</span> <span style="font-weight: bold">Foo</span>' - end + expect(article.content).to include '<span class="tok-nc">Foo</span>' + expect(article.content).to include '<link rel="stylesheet" href="./pygments-bw.css"/>' + expect(book.item_by_href('pygments-bw.css')).not_to be_nil end it 'highlights code listings with Rouge' do - # TODO: This condition might be not quite correct - skip 'No Rouge support in current Asciidoctor version' unless Asciidoctor::Document.supports_syntax_highlighter? - book, = to_epub fixture_file('source_highlight.adoc'), attributes: { 'source-highlighter' => 'rouge' } article = book.item_by_href 'source_highlight.xhtml' expect(article).not_to be_nil |
