-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Fix a false positive for RSpec/ExpectActual with rspec-rails #1764
Conversation
01ac15d
to
a2e2460
Compare
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.
Perfect, thank you!
@@ -50,6 +50,7 @@ class ExpectActual < Base | |||
regexp | |||
].freeze | |||
|
|||
SKIPPED_MATCHERS = %i[route_to be_routable].freeze |
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.
Since we are planning to extract the rspec-rails specific parts from rubocop-rspec, I don’t think we should hardcode these matchers names. Can we either have (the non-existing) rubocop-rspec-rails inject them, or maybe just add a SkippedMatchers
to the configuration?
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.
Could we wait to see how the rails extraction takes shape before doing that? It's true that this is rails-specific, but it's also highly unlikely to matter, since we'd only miss adding offenses for non-rails matchers that happened to be named "route_to" or "be_routable".
c53c48e
to
eaf04e6
Compare
eaf04e6
to
d81260f
Compare
rspec-rails comes with routing matchers that use literals in the `expect()` Fixes rubocop#759
d81260f
to
30eef5c
Compare
rspec-rails comes with routing matchers that use literals in the
expect()
.Fixes #759
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.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
.Enabled: pending
inconfig/default.yml
.Enabled: true
in.rubocop.yml
.VersionAdded: "<<next>>"
indefault/config.yml
.If you have modified an existing cop's configuration options:
VersionChanged: "<<next>>"
inconfig/default.yml
.