From ec8ef120ed845178e9682cf77fbfda05008aba91 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 6 May 2026 22:39:23 +0200 Subject: [PATCH] Remove parser module indirection used in testing The ripper parser is gone, so this is not needed anymore Makes it so that I can easily run individual tests via ruby-lsp It's their limitation really but seems ok to do regardless --- AGENTS.md | 2 +- test/rdoc/parser/ruby_test.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 53e9701699..4e2e8512fd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -238,7 +238,7 @@ exe/ - **Parsers:** Prism-based Ruby (`RDoc::Parser::Ruby`), C, Markdown, RD - **Generators:** HTML/Aliki (default), HTML/Darkfish (deprecated), RI, POT (gettext), JSON, Markup -Parser tests live in the `RDocParserRubyTestCases` module (`test/rdoc/parser/ruby_test.rb`) and are included by `RDocParserRubyTest`. Add new parser tests to the mixin. +Parser tests live in the `RDocParserRubyTest` class (`test/rdoc/parser/ruby_test.rb`). ### Code Object Model and Constant Aliases diff --git a/test/rdoc/parser/ruby_test.rb b/test/rdoc/parser/ruby_test.rb index 40b32ed832..9ec4722b5a 100644 --- a/test/rdoc/parser/ruby_test.rb +++ b/test/rdoc/parser/ruby_test.rb @@ -4,7 +4,7 @@ require 'rdoc/parser' require 'rdoc/parser/ruby' -module RDocParserRubyTestCases +class RDocParserRubyTest < RDoc::TestCase def setup super @@ -2528,10 +2528,6 @@ def m2; end assert_equal "foo1\nbar1", m1.call_seq.chomp assert_equal "ARGF.readlines(a)\nARGF.readlines(b)\nARGF.readlines(c)\nARGF.readlines(d)", m2.call_seq.chomp end -end - -class RDocParserRubyTest < RDoc::TestCase - include RDocParserRubyTestCases def util_parser(content) @parser = RDoc::Parser::Ruby.new @top_level, content, @options, @stats