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

Add rudimentary regexp-based run by line number #3

Merged
merged 3 commits into from Feb 16, 2024
Merged

Conversation

mattbrictson
Copy link
Owner

@mattbrictson mattbrictson commented Feb 16, 2024

The Rails test runner has a robust run-by-line-number implementation that actually parses and understands the Ruby AST for test files.

For mighty_test, let's start with a simpler approach that hopefully covers the common use-cases. Given a line number, we look for method definition like def test_* or an Active Support style declaration like test "..." do. This is done with regular expressions; no fancy Ruby parsing.

There will certainly be edge cases where mighty_test will find the wrong test, or not find any test at all. But I think the feature works well-enough to ship as-is.

@mattbrictson mattbrictson added the ✨ Feature Adds a new feature label Feb 16, 2024
@mattbrictson mattbrictson merged commit 9421d21 into main Feb 16, 2024
6 checks passed
@mattbrictson mattbrictson deleted the test-by-line branch February 16, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant