fix: only group specs if the context or describe call has a block
#87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
If you have a spec with a
letvariable named one of the "reserved" words such ascontextordescribethis gem interprets any usage of those variables as test group. This breaks the VS Code integration since these aren't actually test groups and tests don't actually exist within them.contextis a pretty common and innocuous variable name so this causes a very large number of our specs to not work with this spec.To repro
Use this spec
Observe broken awareness of the spec, lack of code lens support, and incorrect labeling of the context variable as a spec.

The cause
There is a validation to see if a node is actually a test group, but it passes too easily. It's treated as a node group even if there is no block associated with it. In addition, there was no validation performed in
test_discovery,The fix
Actually ensure the node has a block before allowing it to be treated as a test group.
Behold