rubocop-rspec
rubocop-rspec copied to clipboard
[Fix #1337] Update the cop to raise error for insufficient descriptions.
Per issue #1337, I tried to add a generic way to the ExampleWordingCop to call out insufficient descriptions. For now, I've used "works" and "throws errors" as that is a phrase I see used often as well. I didn't use a new cop since insufficient descriptions seemed to be along the same lines as "should not start with should or it" as they are both description related.
Before submitting the PR make sure the following are checked:
- [X] Feature branch is up-to-date with
master
(if not - rebase it). - [X] Squashed related commits together.
- [X] Added tests.
- [X] Updated documentation.
- [X] Added an entry to the
CHANGELOG.md
if the new code introduces user-observable changes. - [X] The build (
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 modified an existing cop's configuration options:
- [X] Set
VersionChanged
inconfig/default.yml
to the next major version.
Thanks @ydah! How do I get this merged? Do I need to wait for the other reviewers to approve?
I would expect the following to pass, but it fails, why?
expect_no_offenses(<<-'RUBY') it "works" \ "totally fine" do end RUBY
Looks like I didn't handle that edge case! updated the check to check for the entire description instead, and added some more test cases! Thanks for the catch!
I have renamed some of the required CI checks, which unfortunately means that you will need to rebase this branch to make CI pass.
Rebased and green @bquorning @Darhazer
Thank you for the contribution and your time, @akrox58 !