Skip to content

Conversation

@thomasmarshall
Copy link
Contributor

Motivation

Closes #3722.

Methods starting test_ are picked up my Minitest but were not being discovered by the LSP.

describe "MySpec" do
  def test_foo
    assert true
  end
end

Implementation

This commit adds a #on_def_node_enter handler to register test items for methods starting test_ in describe blocks. It should not match non-test methods (e.g. helper methods), nor should it match methods named test_ in non-spec blocks.

Automated Tests

I have added a new testfor this fix.

Manual Tests

  1. Add a spec with a test_ method
  2. See that it is discovered by the LSP
Before After
Screenshot 2025-12-04 at 13 03 13 Screenshot 2025-12-04 at 13 04 10

This commit ensures methods starting with "test_" are discovered as test
methods in specs.
@thomasmarshall thomasmarshall requested a review from a team as a code owner December 4, 2025 13:13
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.

Tests defined as test_ methods in spec-style describe blocks are not discovered

1 participant