Skip to content

Make asciidoctor gem optional in tests#1651

Open
Bo98 wants to merge 1 commit intolsegal:mainfrom
Bo98:optional-asciidoctor-test
Open

Make asciidoctor gem optional in tests#1651
Bo98 wants to merge 1 commit intolsegal:mainfrom
Bo98:optional-asciidoctor-test

Conversation

@Bo98
Copy link

@Bo98 Bo98 commented Mar 5, 2026

Description

Everything not in the development group in the Gemfile appears to be optional. There is code elsewhere to skip these gems when they are not installed:

before(:each) do
if html_renderer.markup_class(markup).nil?
skip "Missing markup renderer #{markup}"
end
end

have_gettext_gem = true
if RUBY_VERSION < "1.9"
begin
require "gettext/tools/poparser"
rescue LoadError
have_gettext_gem = false
end
else
begin
require "gettext/po_parser"
rescue LoadError
begin
require "gettext/tools/poparser"
rescue LoadError
have_gettext_gem = false
end
end
end
it "returns true for existent PO", :if => have_gettext_gem do

This wasn't however the case for asciidoctor, which is currently required to be installed for the tests to pass.

This fixes the affected tests on Ruby 4.0 as asciidoctor doesn't support Ruby 4.0 upstream yet.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

@Bo98 Bo98 mentioned this pull request Mar 5, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant