Skip to content

Commit

Permalink
[Wip] Fix an error for unrecognized cop or department `RSpecRails/Htt…
Browse files Browse the repository at this point in the history
…pStatus` when also using rubocop-rails
  • Loading branch information
ydah committed Mar 30, 2024
1 parent ccd821e commit bc7b36e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,20 @@ module SpecHelper

require 'rubocop-rspec'
require 'rubocop-rspec_rails'

module RuboCop
module Cop
class AmbiguousCopName
prepend(Module.new do
def qualified_cop_name(name, path, warn: true)
if name == 'RSpec/Rails/HttpStatus'
badge = Badge.parse(name)
return resolve_badge(badge, qualify_badge(badge).first, path)
end

super
end
end)
end
end
end

0 comments on commit bc7b36e

Please sign in to comment.