Skip to content

Commit

Permalink
Change superclass for many cops
Browse files Browse the repository at this point in the history
Let's depend as little as possible on `::RuboCop::Cop::RSpec::Base` as
cop superclass.

Now, only `InferredSpecType` inherits from rubocop-rspec's base class.
  • Loading branch information
bquorning committed Mar 31, 2024
1 parent 2f02f4b commit 9317157
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec_rails/avoid_setup_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module RSpecRails
# allow(foo).to receive(:bar)
# end
#
class AvoidSetupHook < ::RuboCop::Cop::RSpec::Base
class AvoidSetupHook < ::RuboCop::Cop::Base
extend AutoCorrector

MSG = 'Use `before` instead of `setup`.'
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec_rails/http_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module RSpecRails
# it { is_expected.to have_http_status :success }
# it { is_expected.to have_http_status :error }
#
class HttpStatus < ::RuboCop::Cop::RSpec::Base
class HttpStatus < ::RuboCop::Cop::Base
extend AutoCorrector
include ConfigurableEnforcedStyle
RESTRICT_ON_SEND = %i[have_http_status].freeze
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec_rails/minitest_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module RSpecRails
# expect(a).to be(true)
# expect(a).to be(false)
#
class MinitestAssertions < ::RuboCop::Cop::RSpec::Base
class MinitestAssertions < ::RuboCop::Cop::Base
extend AutoCorrector

# :nodoc:
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec_rails/negation_be_valid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module RSpecRails
# # good (with method chain)
# expect(foo).to be_invalid.or be_even
#
class NegationBeValid < ::RuboCop::Cop::RSpec::Base
class NegationBeValid < ::RuboCop::Cop::Base
extend AutoCorrector
include ConfigurableEnforcedStyle

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec_rails/travel_around.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module RSpecRails
#
# # good
# before { freeze_time }
class TravelAround < ::RuboCop::Cop::RSpec::Base
class TravelAround < ::RuboCop::Cop::Base
extend AutoCorrector

MSG = 'Prefer to travel in `before` rather than `around`.'
Expand Down

0 comments on commit 9317157

Please sign in to comment.