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

Accept declarative test syntax for minitest #2176

Closed
1 task done
ianks opened this issue Jun 12, 2024 · 3 comments
Closed
1 task done

Accept declarative test syntax for minitest #2176

ianks opened this issue Jun 12, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ianks
Copy link

ianks commented Jun 12, 2024

I have checked that this feature is not already implemented

  • This feature does not exist

Use case

We have an app (storefront renderer) which uses minitest outside of Rails with custom test do ... end syntax, and would like to have the Run test code lens.

image

Description

Add code lens for individual test case without rails.

Implementation

No response

@ianks ianks added the enhancement New feature or request label Jun 12, 2024
@vinistock
Copy link
Member

Thank you for the feature suggestion!

Do the tests inherit from ActiveSupport::TestCase? If that's the case, then #1334 is the solution and we can close this one.

@ianks
Copy link
Author

ianks commented Jun 13, 2024

Unfortunately it does not, although maybe it could but it would be some work. Here's what the class looks like:

module StorefrontRenderer
  class TestCase < Minitest::Test
    # ...
  end
end

@vinistock
Copy link
Member

Minitest doesn't support the declarative syntax out of the box, so it would be a bit odd to pretend that it does and show the code lens anyway.

I believe there is a specific solution for your use case and a more general solution for any other type of custom syntax:

  1. SFR should just use ActiveSupport::TestCase or at least ActiveSupport::Testing::Declarative and then Use ancestors to determine test framework in code lens #1334 will fix this and allow the correct behaviour
  2. For any other arbitrary custom syntax people decide to create, we should allow applications to define their own private addons, which is a way to extend the Ruby LSP's functionality. For example, RSpec support is implemented that way. Currently, we only allow for gems to export addons, but the change to allow for application addons should be straight forward

I'll close this issue so that we can centralize any discussions on #1334.

@vinistock vinistock closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants