Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minitest spec code lens selectors #2706

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Commits on Oct 10, 2024

  1. Add minitest/spec code lens test

    This commit adds a test case capturing the current behavior of code lens
    generation for minitest/spec tests. Although the behavior is actually
    incorrect, it's useful to have a test case capturing how it currently
    works. In later commits, we'll fix the behavior and update this test.
    thomasmarshall committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    02fdf49 View commit details
    Browse the repository at this point in the history
  2. Fix spec code lens inside classes

    Minitest specs don't include the class name in the test selector, so we
    need to strip out the class name (including the module nesting) when we
    generate the selector.
    
    This commit changes `@group_stack` to be a tuple of `[type, value]` so
    we can distinguish between class/module names and test group/example
    names. For specs, it removes the class/module names from the stack.
    thomasmarshall committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    9d02cb3 View commit details
    Browse the repository at this point in the history
  3. Set load path based on test/spec directory

    Some codebases (particularly those using minitest/spec) have tests in
    the `spec` directory instead of the `test` directory. This commit adds
    support for detecting these paths and adjusting the load path
    accordingly.
    thomasmarshall committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    c243daf View commit details
    Browse the repository at this point in the history