Skip to content

Commit 6f469d1

Browse files
zkoppertCopilot
andcommitted
Exclude legacy RDoc < 4 fallback from coverage
The `else` branch is for RDoc < 4, which has been unsupported since Ruby 2.4 (2016). Modern RDoc requires Options. The branch is unreachable in any supported environment, so guard it with :nocov: markers rather than contort the test suite to fake an unsupported RDoc version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zack Koppert <zkoppert@github.com>
1 parent 149bafd commit 6f469d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/github/markup/rdoc.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ def render(filename, content, options: {})
1313
if ::RDoc::VERSION.to_i >= 4
1414
h = ::RDoc::Markup::ToHtml.new(::RDoc::Options.new)
1515
else
16+
# :nocov: RDoc < 4 has been unsupported since Ruby 2.4 (2016); modern RDoc requires Options.
1617
h = ::RDoc::Markup::ToHtml.new
18+
# :nocov:
1719
end
1820
h.convert(content)
1921
end

0 commit comments

Comments
 (0)