Skip to content
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 an error for RSpecRails/HttpStatus when no rack gem is loaded with rubocop-rspec #13

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Mar 30, 2024

Fix: #9


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • [-] Added tests.
  • [-] Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@ydah ydah marked this pull request as ready for review March 30, 2024 16:03
@ydah ydah requested a review from a team as a code owner March 30, 2024 16:03
@@ -64,6 +68,8 @@ class HttpStatus < ::RuboCop::Cop::RSpec::Base
PATTERN

def on_send(node)
return unless defined?(::Rack::Utils::SYMBOL_TO_STATUS_CODE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The performance of this line could probably be optimized, but given that it’s a temporary change I think it’s fine.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bquorning Good catch, 👍

@ydah ydah merged commit ccd821e into master Mar 30, 2024
27 checks passed
@ydah ydah deleted the fix-error3 branch March 30, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants