-
-
Notifications
You must be signed in to change notification settings - Fork 285
Take metadata into account in RSpec/RepeatedDescription cop
#874
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
Take metadata into account in RSpec/RepeatedDescription cop
#874
Conversation
2000093 to
3fb09b9
Compare
pirj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🙌
|
|
||
| grouped_examples | ||
| .select { |description, group| description && group.size > 1 } | ||
| .select { |signatures, group| !signatures.empty? && group.size > 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe signatures.any??
In this case compact below becomes redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
RSpec/RepeatedDescription cop
|
@bquorning @Darhazer we have plenty of changes to release! |
| RUBY | ||
| end | ||
|
|
||
| it 'does not flag examples if metadata is different' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if there is the same metatada? with same description? With different descriptions?
I would convert this to a context and add a couple of more examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added two more tests
Unfortunately, I don't have access to rubygems to push releases. But I agree, let's release a new version after this one is merged |
|
I’ll release a new version after this PR has been merged. As mentioned by @Darhazer, we should probably have a few more specs first. |
3fb09b9 to
5024a13
Compare
bquorning
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🎉
Close #873
RSpec/RepeatedDescriptionwill take metadata into account and will not flag examples like belowBefore submitting the PR make sure the following are checked:
master(if not - rebase it).bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).If you have created a new cop:
config/default.yml.