-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
v1.43.0 Regression: EmptyExampleGroup
incorrectly flags custom example groups w/ block arguments
#1006
Comments
I guess This is going to be resolved with #956 with configurable RSpec DSL. I.e. you'll be able to extend your configuration: AllCops:
RSpec:
Language:
Examples:
Regular:
- 'run_test!' |
yup, it's a wrapper that essentially does: it 'matches the expected format' do
submit_request
assert_response_matches_metadata # http code, headers, json structure, etc...
yield
end See here for details: https://github.com/rswag/rswag#paths-operations-and-responses |
Got it. I recommend disabling the cop temporarily and turning it back on when #956 is merged and released. It's going to happen in 2.0, and I'd love to say that it will happen really soon, but we depend on the parent project with the major release. |
@pirj I'm assuming this won't fix a similar issue that I'm having. We have some shared examples in our project with one-liner tests inside of conditionals/ternaries. Those shared examples are now being flagged as empty due to this change. I understand that examples inside of conditionals might be violating some other principle, but it seems like a misnomer to be considered an "empty example group". Should I open a separate issue? |
@single-stop-tony Quite an interesting case. Have you considered using RSpec's conditional filters? Yes, please open a separate ticket. |
I have not! Might be a useful cop to add as well |
Mercy! Our backlog of useful cops is overflown :D |
Running v1.43.1, I've run into a regression where the
EmptyExampleGroup
cop is now incorrectly flagging custom includes that take a block argument. In my case, it's arun_test!
method that makes a request and expects the response to match a swagger spec, and optionally takes additional expectations within a block.Reproducible with the following failing test:
Failure:
The text was updated successfully, but these errors were encountered: