Skip to content

Commit

Permalink
Use non-RSpec base cop for departments
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed Dec 11, 2022
1 parent f941a9c commit 1d545b7
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Capybara
# # good
# expect(page).to have_current_path('/callback')
#
class CurrentPathExpectation < Base
class CurrentPathExpectation < ::RuboCop::Cop::Base
extend AutoCorrector

MSG = 'Do not set an RSpec expectation on `current_path` in ' \
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/capybara/negation_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module Capybara
# expect(page).to have_no_selector
# expect(page).to have_no_css('a')
#
class NegationMatcher < Base
class NegationMatcher < ::RuboCop::Cop::Base
extend AutoCorrector
include ConfigurableEnforcedStyle

Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/capybara/specific_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module Capybara
# click_link(exact_text: 'foo')
# find('div').click_button
#
class SpecificActions < Base
class SpecificActions < ::RuboCop::Cop::Base
MSG = "Prefer `%<good_action>s` over `find('%<selector>s').click`."
RESTRICT_ON_SEND = %i[click].freeze
SPECIFIC_ACTION = {
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/capybara/specific_finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Capybara
# find_by_id('some-id')
# find_by_id('some-id', visible: true)
#
class SpecificFinders < Base
class SpecificFinders < ::RuboCop::Cop::Base
extend AutoCorrector

include RangeHelp
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/capybara/specific_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Capybara
# expect(page).to have_select
# expect(page).to have_field('foo')
#
class SpecificMatcher < Base
class SpecificMatcher < ::RuboCop::Cop::Base
MSG = 'Prefer `%<good_matcher>s` over `%<bad_matcher>s`.'
RESTRICT_ON_SEND = %i[have_selector have_no_selector have_css
have_no_css].freeze
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module Capybara
# expect(page).to have_css('.foo', visible: :all)
# expect(page).to have_link('my link', visible: :hidden)
#
class VisibilityMatcher < Base
class VisibilityMatcher < ::RuboCop::Cop::Base
MSG_FALSE = 'Use `:all` or `:hidden` instead of `false`.'
MSG_TRUE = 'Use `:visible` instead of `true`.'
CAPYBARA_MATCHER_METHODS = %w[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module FactoryBot
# # good
# count { 1 }
#
class AttributeDefinedStatically < Base
class AttributeDefinedStatically < ::RuboCop::Cop::Base
extend AutoCorrector

MSG = 'Use a block to declare attribute values.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module FactoryBot
# name: 'foo'
# )
#
class ConsistentParenthesesStyle < Base
class ConsistentParenthesesStyle < ::RuboCop::Cop::Base
extend AutoCorrector
include ConfigurableEnforcedStyle
include RuboCop::RSpec::FactoryBot::Language
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/factory_bot/create_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module FactoryBot
# # good
# 3.times { create :user }
#
class CreateList < Base
class CreateList < ::RuboCop::Cop::Base
extend AutoCorrector
include ConfigurableEnforcedStyle
include RuboCop::RSpec::FactoryBot::Language
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module FactoryBot
# factory :foo, class: 'Foo' do
# end
#
class FactoryClassName < Base
class FactoryClassName < ::RuboCop::Cop::Base
extend AutoCorrector

MSG = "Pass '%<class_name>s' string instead of `%<class_name>s` " \
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/factory_bot/factory_name_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module FactoryBot
# create('user')
# build "user", username: "NAME"
#
class FactoryNameStyle < Base
class FactoryNameStyle < ::RuboCop::Cop::Base
extend AutoCorrector
include ConfigurableEnforcedStyle
include RuboCop::RSpec::FactoryBot::Language
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/rails/have_http_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Rails
# # good
# expect(response).to have_http_status(200)
#
class HaveHttpStatus < Base
class HaveHttpStatus < ::RuboCop::Cop::Base
extend AutoCorrector

MSG =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

RSpec.describe RuboCop::Cop::RSpec::FactoryBot::FactoryNameStyle,
:config do
RSpec.describe RuboCop::Cop::RSpec::FactoryBot::FactoryNameStyle, :config do
let(:cop_config) do
{ 'EnforcedStyle' => enforced_style }
end
Expand Down

0 comments on commit 1d545b7

Please sign in to comment.