-
Notifications
You must be signed in to change notification settings - Fork 9
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
What's a good value for RSpec example length? #248
Comments
mokagio
added a commit
that referenced
this issue
May 3, 2021
This was to comply with the RuboCop rule on the example length, which wants examples at 5 lines or less. To be honest, I feel like I'm cheating a bit here and I feel maybe the test is less readable as a result. Opened #248 to track this discussion.
As an aside, something else I could have done was extracting that setup logic in a method so that it would have been a one liner all in the example and I would have satisfied the RuboCop requirement 🤔 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When working on #242, I added some tests and RuboCop warned me they should have been 5 lines or less.
I addressed the violation with a cheap trick.
I'm all in for having short methods actually, I do really like the Sandi Metz rules. But, in the context of that commit, I feel like I didn't make the test more readable.
I can see two options:
The text was updated successfully, but these errors were encountered: