Skip to content

Commit

Permalink
use pygments.rb 2.0.0 in CI (PR #1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus authored Jan 22, 2021
1 parent 9432cb0 commit bcdab94
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
ASCIIDOCTOR_DIAGRAM_VERSION: '~> 2.1.0'
MENTOS_TIMEOUT: 30 # give pygments.rb calls more time to execute (in seconds)
PYGMENTS_VERSION: '~> 1.2.0' # test runner will automatically disable Pygments tests on JRuby for Windows
PYGMENTS_VERSION: '~> 2.0.0'
RGHOST_VERSION: '0.9.7'
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
name: ${{ github.event.client_payload.message }}
runs-on: ubuntu-latest
env:
PYGMENTS_VERSION: '~> 1.2.0'
PYGMENTS_VERSION: '~> 2.0.0'
RGHOST_VERSION: '0.9.7'
PRAWN_GMAGICK_VERSION: '0.0.9'
steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Build / Infrastructure::
* enable CI job on macOS (#1817)
* test against Asciidoctor upstream (#1821)
* skip tests for unreadable files when euid is 0
* test against pygments.rb 2.0.0

== 1.5.3 (2020-02-28) - @mojavelinux

Expand Down
13 changes: 8 additions & 5 deletions spec/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ class Type; end
end
end

context 'Pygments', if: (gem_available? 'pygments.rb') && !(windows? && jruby?), &(proc do
context 'Pygments', if: (gem_available? 'pygments.rb'), &(proc do
it 'should highlight source using Pygments if source-highlighter is pygments' do
pdf = to_pdf <<~'EOS', analyze: true
:source-highlighter: pygments
Expand Down Expand Up @@ -977,9 +977,12 @@ class << xml_lexer
key: "value"
----
EOS
(expect pdf.find_text 'category:').to have_size 1
(expect pdf.find_text %(\u00a0 hash:)).to have_size 1
(expect pdf.find_text %(\u00a0 key: )).to have_size 1
(expect pdf.find_text %r/: ?/).to have_size 3
lines = pdf.lines
(expect lines).to have_size 3
(expect lines[0]).to eql 'category:'
(expect lines[1]).to eql %(\u00a0 hash:)
(expect lines[2]).to eql %(\u00a0 key: "value")
(expect pdf.find_text '"value"').to have_size 1
end).not_to raise_exception
end
Expand Down Expand Up @@ -1549,7 +1552,7 @@ def highlight?
end

it 'should preserve space before callout on final line' do
['rouge', (gem_available? 'pygments.rb') && !(windows? && jruby?) ? 'pygments' : nil].compact.each do |highlighter|
['rouge', (gem_available? 'pygments.rb') ? 'pygments' : nil].compact.each do |highlighter|
pdf = to_pdf <<~'EOS', attribute_overrides: { 'source-highlighter' => highlighter }, analyze: true
[source,java]
----
Expand Down

0 comments on commit bcdab94

Please sign in to comment.