From 6438df3a1e0fb944485cebf07976160184697d72 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 20 Jan 2021 13:34:23 -0600 Subject: Add latest changes from gitlab-org/gitlab@13-8-stable-ee --- .../cop/active_record_association_reload_spec.rb | 2 +- spec/rubocop/cop/api/base_spec.rb | 2 +- spec/rubocop/cop/avoid_becomes_spec.rb | 2 +- .../cop/avoid_break_from_strong_memoize_spec.rb | 2 +- ...id_keyword_arguments_in_sidekiq_workers_spec.rb | 2 +- spec/rubocop/cop/avoid_return_from_blocks_spec.rb | 2 +- .../cop/avoid_route_redirect_leading_slash_spec.rb | 2 +- spec/rubocop/cop/ban_catch_throw_spec.rb | 2 +- spec/rubocop/cop/code_reuse/finder_spec.rb | 2 +- spec/rubocop/cop/code_reuse/presenter_spec.rb | 2 +- spec/rubocop/cop/code_reuse/serializer_spec.rb | 2 +- spec/rubocop/cop/code_reuse/service_class_spec.rb | 2 +- spec/rubocop/cop/code_reuse/worker_spec.rb | 2 +- spec/rubocop/cop/default_scope_spec.rb | 2 +- spec/rubocop/cop/destroy_all_spec.rb | 2 +- spec/rubocop/cop/filename_length_spec.rb | 2 +- .../gitlab/avoid_uploaded_file_from_params_spec.rb | 2 +- spec/rubocop/cop/gitlab/bulk_insert_spec.rb | 2 +- spec/rubocop/cop/gitlab/change_timezone_spec.rb | 2 +- .../cop/gitlab/const_get_inherit_false_spec.rb | 2 +- .../cop/gitlab/duplicate_spec_location_spec.rb | 2 +- spec/rubocop/cop/gitlab/except_spec.rb | 2 +- .../rubocop/cop/gitlab/finder_with_find_by_spec.rb | 2 +- spec/rubocop/cop/gitlab/httparty_spec.rb | 2 +- spec/rubocop/cop/gitlab/intersect_spec.rb | 2 +- spec/rubocop/cop/gitlab/json_spec.rb | 2 +- .../gitlab/module_with_instance_variables_spec.rb | 2 +- .../rubocop/cop/gitlab/policy_rule_boolean_spec.rb | 2 +- .../cop/gitlab/predicate_memoization_spec.rb | 2 +- spec/rubocop/cop/gitlab/rails_logger_spec.rb | 2 +- spec/rubocop/cop/gitlab/union_spec.rb | 2 +- spec/rubocop/cop/graphql/authorize_types_spec.rb | 2 +- spec/rubocop/cop/graphql/descriptions_spec.rb | 2 +- spec/rubocop/cop/graphql/gid_expected_type_spec.rb | 2 +- spec/rubocop/cop/graphql/id_type_spec.rb | 2 +- spec/rubocop/cop/graphql/json_type_spec.rb | 2 +- spec/rubocop/cop/graphql/resolver_type_spec.rb | 2 +- .../cop/group_public_or_visible_to_user_spec.rb | 2 +- spec/rubocop/cop/ignored_columns_spec.rb | 2 +- spec/rubocop/cop/include_sidekiq_worker_spec.rb | 2 +- .../cop/inject_enterprise_edition_module_spec.rb | 2 +- .../rubocop/cop/lint/last_keyword_argument_spec.rb | 29 ++++++++++++++++++++-- .../cop/migration/add_column_with_default_spec.rb | 2 +- .../migration/add_columns_to_wide_tables_spec.rb | 2 +- .../migration/add_concurrent_foreign_key_spec.rb | 2 +- .../cop/migration/add_concurrent_index_spec.rb | 2 +- spec/rubocop/cop/migration/add_index_spec.rb | 2 +- .../migration/add_limit_to_text_columns_spec.rb | 2 +- spec/rubocop/cop/migration/add_reference_spec.rb | 2 +- spec/rubocop/cop/migration/add_timestamps_spec.rb | 2 +- .../migration/complex_indexes_require_name_spec.rb | 2 +- .../create_table_with_foreign_keys_spec.rb | 2 +- spec/rubocop/cop/migration/datetime_spec.rb | 2 +- spec/rubocop/cop/migration/drop_table_spec.rb | 2 +- spec/rubocop/cop/migration/hash_index_spec.rb | 2 +- spec/rubocop/cop/migration/prevent_strings_spec.rb | 2 +- .../cop/migration/refer_to_index_by_name_spec.rb | 2 +- spec/rubocop/cop/migration/remove_column_spec.rb | 2 +- .../cop/migration/remove_concurrent_index_spec.rb | 2 +- spec/rubocop/cop/migration/remove_index_spec.rb | 2 +- .../cop/migration/safer_boolean_column_spec.rb | 2 +- spec/rubocop/cop/migration/timestamps_spec.rb | 2 +- .../cop/migration/update_column_in_batches_spec.rb | 2 +- .../with_lock_retries_disallowed_method_spec.rb | 2 +- .../with_lock_retries_with_change_spec.rb | 2 +- spec/rubocop/cop/performance/ar_count_each_spec.rb | 2 +- .../ar_exists_and_present_blank_spec.rb | 2 +- .../rubocop/cop/performance/readlines_each_spec.rb | 2 +- .../cop/prefer_class_methods_over_module_spec.rb | 2 +- spec/rubocop/cop/project_path_helper_spec.rb | 2 +- .../cop/put_group_routes_under_scope_spec.rb | 2 +- .../cop/put_project_routes_under_scope_spec.rb | 2 +- .../cop/qa/ambiguous_page_object_name_spec.rb | 2 +- spec/rubocop/cop/qa/element_with_pattern_spec.rb | 2 +- spec/rubocop/cop/rspec/any_instance_of_spec.rb | 2 +- spec/rubocop/cop/rspec/be_success_matcher_spec.rb | 2 +- spec/rubocop/cop/rspec/env_assignment_spec.rb | 2 +- .../cop/rspec/factories_in_migration_specs_spec.rb | 2 +- .../rspec/factory_bot/inline_association_spec.rb | 2 +- .../rubocop/cop/rspec/htt_party_basic_auth_spec.rb | 2 +- .../cop/rspec/modify_sidekiq_middleware_spec.rb | 2 +- spec/rubocop/cop/rspec/timecop_freeze_spec.rb | 2 +- spec/rubocop/cop/rspec/timecop_travel_spec.rb | 2 +- .../cop/rspec/top_level_describe_path_spec.rb | 2 +- spec/rubocop/cop/rspec/web_mock_enable_spec.rb | 22 ++++++++++++++++ .../cop/ruby_interpolation_in_translation_spec.rb | 2 +- spec/rubocop/cop/safe_params_spec.rb | 2 +- .../scalability/bulk_perform_with_context_spec.rb | 2 +- .../cop/scalability/cron_worker_context_spec.rb | 2 +- spec/rubocop/cop/scalability/file_uploads_spec.rb | 2 +- .../cop/scalability/idempotent_worker_spec.rb | 2 +- spec/rubocop/cop/sidekiq_options_queue_spec.rb | 2 +- .../cop/static_translation_definition_spec.rb | 2 +- .../distinct_count_by_large_foreign_key_spec.rb | 2 +- spec/rubocop/cop/usage_data/large_table_spec.rb | 2 +- spec/rubocop/qa_helpers_spec.rb | 2 +- 96 files changed, 143 insertions(+), 96 deletions(-) create mode 100644 spec/rubocop/cop/rspec/web_mock_enable_spec.rb (limited to 'spec/rubocop') diff --git a/spec/rubocop/cop/active_record_association_reload_spec.rb b/spec/rubocop/cop/active_record_association_reload_spec.rb index e8d46064b49..8dbe6daeeca 100644 --- a/spec/rubocop/cop/active_record_association_reload_spec.rb +++ b/spec/rubocop/cop/active_record_association_reload_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../rubocop/cop/active_record_association_reload' -RSpec.describe RuboCop::Cop::ActiveRecordAssociationReload, type: :rubocop do +RSpec.describe RuboCop::Cop::ActiveRecordAssociationReload do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/api/base_spec.rb b/spec/rubocop/cop/api/base_spec.rb index 893bcf49627..de05ab93874 100644 --- a/spec/rubocop/cop/api/base_spec.rb +++ b/spec/rubocop/cop/api/base_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/api/base' -RSpec.describe RuboCop::Cop::API::Base, type: :rubocop do +RSpec.describe RuboCop::Cop::API::Base do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/avoid_becomes_spec.rb b/spec/rubocop/cop/avoid_becomes_spec.rb index 3e3e3abc27d..07cf374faf5 100644 --- a/spec/rubocop/cop/avoid_becomes_spec.rb +++ b/spec/rubocop/cop/avoid_becomes_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/avoid_becomes' -RSpec.describe RuboCop::Cop::AvoidBecomes, type: :rubocop do +RSpec.describe RuboCop::Cop::AvoidBecomes do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb index 4fb47e758bb..3c3aa5b7b5c 100644 --- a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb +++ b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../rubocop/cop/avoid_break_from_strong_memoize' -RSpec.describe RuboCop::Cop::AvoidBreakFromStrongMemoize, type: :rubocop do +RSpec.describe RuboCop::Cop::AvoidBreakFromStrongMemoize do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers_spec.rb b/spec/rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers_spec.rb index 851493e004e..1e1fe851840 100644 --- a/spec/rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers_spec.rb +++ b/spec/rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers' -RSpec.describe RuboCop::Cop::AvoidKeywordArgumentsInSidekiqWorkers, type: :rubocop do +RSpec.describe RuboCop::Cop::AvoidKeywordArgumentsInSidekiqWorkers do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/avoid_return_from_blocks_spec.rb b/spec/rubocop/cop/avoid_return_from_blocks_spec.rb index a157183646c..71311b9df7f 100644 --- a/spec/rubocop/cop/avoid_return_from_blocks_spec.rb +++ b/spec/rubocop/cop/avoid_return_from_blocks_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../rubocop/cop/avoid_return_from_blocks' -RSpec.describe RuboCop::Cop::AvoidReturnFromBlocks, type: :rubocop do +RSpec.describe RuboCop::Cop::AvoidReturnFromBlocks do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/avoid_route_redirect_leading_slash_spec.rb b/spec/rubocop/cop/avoid_route_redirect_leading_slash_spec.rb index 78bc859beda..9e13a5278e3 100644 --- a/spec/rubocop/cop/avoid_route_redirect_leading_slash_spec.rb +++ b/spec/rubocop/cop/avoid_route_redirect_leading_slash_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../rubocop/cop/avoid_route_redirect_leading_slash' -RSpec.describe RuboCop::Cop::AvoidRouteRedirectLeadingSlash, type: :rubocop do +RSpec.describe RuboCop::Cop::AvoidRouteRedirectLeadingSlash do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/ban_catch_throw_spec.rb b/spec/rubocop/cop/ban_catch_throw_spec.rb index 1d0ccb6d262..4f669bad4af 100644 --- a/spec/rubocop/cop/ban_catch_throw_spec.rb +++ b/spec/rubocop/cop/ban_catch_throw_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/ban_catch_throw' -RSpec.describe RuboCop::Cop::BanCatchThrow, type: :rubocop do +RSpec.describe RuboCop::Cop::BanCatchThrow do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/finder_spec.rb b/spec/rubocop/cop/code_reuse/finder_spec.rb index 1935d825b19..6f04d5e0d60 100644 --- a/spec/rubocop/cop/code_reuse/finder_spec.rb +++ b/spec/rubocop/cop/code_reuse/finder_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/finder' -RSpec.describe RuboCop::Cop::CodeReuse::Finder, type: :rubocop do +RSpec.describe RuboCop::Cop::CodeReuse::Finder do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/presenter_spec.rb b/spec/rubocop/cop/code_reuse/presenter_spec.rb index 1366018ec12..8efd4da8aa1 100644 --- a/spec/rubocop/cop/code_reuse/presenter_spec.rb +++ b/spec/rubocop/cop/code_reuse/presenter_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/presenter' -RSpec.describe RuboCop::Cop::CodeReuse::Presenter, type: :rubocop do +RSpec.describe RuboCop::Cop::CodeReuse::Presenter do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/serializer_spec.rb b/spec/rubocop/cop/code_reuse/serializer_spec.rb index d4341cc0367..74999df5859 100644 --- a/spec/rubocop/cop/code_reuse/serializer_spec.rb +++ b/spec/rubocop/cop/code_reuse/serializer_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/serializer' -RSpec.describe RuboCop::Cop::CodeReuse::Serializer, type: :rubocop do +RSpec.describe RuboCop::Cop::CodeReuse::Serializer do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/service_class_spec.rb b/spec/rubocop/cop/code_reuse/service_class_spec.rb index b018e743230..4870daf72dc 100644 --- a/spec/rubocop/cop/code_reuse/service_class_spec.rb +++ b/spec/rubocop/cop/code_reuse/service_class_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/service_class' -RSpec.describe RuboCop::Cop::CodeReuse::ServiceClass, type: :rubocop do +RSpec.describe RuboCop::Cop::CodeReuse::ServiceClass do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/worker_spec.rb b/spec/rubocop/cop/code_reuse/worker_spec.rb index 1f502e554c4..9e015f286d8 100644 --- a/spec/rubocop/cop/code_reuse/worker_spec.rb +++ b/spec/rubocop/cop/code_reuse/worker_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/worker' -RSpec.describe RuboCop::Cop::CodeReuse::Worker, type: :rubocop do +RSpec.describe RuboCop::Cop::CodeReuse::Worker do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/default_scope_spec.rb b/spec/rubocop/cop/default_scope_spec.rb index 617a7f63497..fee1895603c 100644 --- a/spec/rubocop/cop/default_scope_spec.rb +++ b/spec/rubocop/cop/default_scope_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/default_scope' -RSpec.describe RuboCop::Cop::DefaultScope, type: :rubocop do +RSpec.describe RuboCop::Cop::DefaultScope do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/destroy_all_spec.rb b/spec/rubocop/cop/destroy_all_spec.rb index 3220d44ea2b..df664724a91 100644 --- a/spec/rubocop/cop/destroy_all_spec.rb +++ b/spec/rubocop/cop/destroy_all_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/destroy_all' -RSpec.describe RuboCop::Cop::DestroyAll, type: :rubocop do +RSpec.describe RuboCop::Cop::DestroyAll do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/filename_length_spec.rb b/spec/rubocop/cop/filename_length_spec.rb index 381218c61ed..2411c8dbc7b 100644 --- a/spec/rubocop/cop/filename_length_spec.rb +++ b/spec/rubocop/cop/filename_length_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/filename_length' -RSpec.describe RuboCop::Cop::FilenameLength, type: :rubocop do +RSpec.describe RuboCop::Cop::FilenameLength do subject(:cop) { described_class.new } it 'does not flag files with names 100 characters long' do diff --git a/spec/rubocop/cop/gitlab/avoid_uploaded_file_from_params_spec.rb b/spec/rubocop/cop/gitlab/avoid_uploaded_file_from_params_spec.rb index 8341b0cab3a..2db03898e01 100644 --- a/spec/rubocop/cop/gitlab/avoid_uploaded_file_from_params_spec.rb +++ b/spec/rubocop/cop/gitlab/avoid_uploaded_file_from_params_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/avoid_uploaded_file_from_params' -RSpec.describe RuboCop::Cop::Gitlab::AvoidUploadedFileFromParams, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::AvoidUploadedFileFromParams do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/bulk_insert_spec.rb b/spec/rubocop/cop/gitlab/bulk_insert_spec.rb index d1236865897..ad7e685e505 100644 --- a/spec/rubocop/cop/gitlab/bulk_insert_spec.rb +++ b/spec/rubocop/cop/gitlab/bulk_insert_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/bulk_insert' -RSpec.describe RuboCop::Cop::Gitlab::BulkInsert, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::BulkInsert do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/change_timezone_spec.rb b/spec/rubocop/cop/gitlab/change_timezone_spec.rb index 1ec5f28e811..6abbc06bb1a 100644 --- a/spec/rubocop/cop/gitlab/change_timezone_spec.rb +++ b/spec/rubocop/cop/gitlab/change_timezone_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/change_timzone' -RSpec.describe RuboCop::Cop::Gitlab::ChangeTimezone, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::ChangeTimezone do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/const_get_inherit_false_spec.rb b/spec/rubocop/cop/gitlab/const_get_inherit_false_spec.rb index 97ed6b743f9..bed06ab2b17 100644 --- a/spec/rubocop/cop/gitlab/const_get_inherit_false_spec.rb +++ b/spec/rubocop/cop/gitlab/const_get_inherit_false_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/const_get_inherit_false' -RSpec.describe RuboCop::Cop::Gitlab::ConstGetInheritFalse, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/duplicate_spec_location_spec.rb b/spec/rubocop/cop/gitlab/duplicate_spec_location_spec.rb index 1ed21e44290..5804b03b641 100644 --- a/spec/rubocop/cop/gitlab/duplicate_spec_location_spec.rb +++ b/spec/rubocop/cop/gitlab/duplicate_spec_location_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require_relative '../../../../rubocop/cop/gitlab/duplicate_spec_location' -RSpec.describe RuboCop::Cop::Gitlab::DuplicateSpecLocation, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::DuplicateSpecLocation do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/except_spec.rb b/spec/rubocop/cop/gitlab/except_spec.rb index 50277d15a57..173e5943da5 100644 --- a/spec/rubocop/cop/gitlab/except_spec.rb +++ b/spec/rubocop/cop/gitlab/except_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/except' -RSpec.describe RuboCop::Cop::Gitlab::Except, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::Except do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/finder_with_find_by_spec.rb b/spec/rubocop/cop/gitlab/finder_with_find_by_spec.rb index a47625d5dc1..db3bcf1dfdb 100644 --- a/spec/rubocop/cop/gitlab/finder_with_find_by_spec.rb +++ b/spec/rubocop/cop/gitlab/finder_with_find_by_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/finder_with_find_by' -RSpec.describe RuboCop::Cop::Gitlab::FinderWithFindBy, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::FinderWithFindBy do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/httparty_spec.rb b/spec/rubocop/cop/gitlab/httparty_spec.rb index 379365096ba..b112ac84bff 100644 --- a/spec/rubocop/cop/gitlab/httparty_spec.rb +++ b/spec/rubocop/cop/gitlab/httparty_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/httparty' -RSpec.describe RuboCop::Cop::Gitlab::HTTParty, type: :rubocop do # rubocop:disable RSpec/FilePath +RSpec.describe RuboCop::Cop::Gitlab::HTTParty do # rubocop:disable RSpec/FilePath include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/intersect_spec.rb b/spec/rubocop/cop/gitlab/intersect_spec.rb index 351033d0ed2..e724f47029c 100644 --- a/spec/rubocop/cop/gitlab/intersect_spec.rb +++ b/spec/rubocop/cop/gitlab/intersect_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/intersect' -RSpec.describe RuboCop::Cop::Gitlab::Intersect, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::Intersect do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/json_spec.rb b/spec/rubocop/cop/gitlab/json_spec.rb index 6f5ec07ffb1..fc25f69a244 100644 --- a/spec/rubocop/cop/gitlab/json_spec.rb +++ b/spec/rubocop/cop/gitlab/json_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/json' -RSpec.describe RuboCop::Cop::Gitlab::Json, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::Json do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb b/spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb index 3d22201c92e..1d09c720bf7 100644 --- a/spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb +++ b/spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/module_with_instance_variables' -RSpec.describe RuboCop::Cop::Gitlab::ModuleWithInstanceVariables, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::ModuleWithInstanceVariables do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/policy_rule_boolean_spec.rb b/spec/rubocop/cop/gitlab/policy_rule_boolean_spec.rb index 6221d038512..e6fb9ab9d57 100644 --- a/spec/rubocop/cop/gitlab/policy_rule_boolean_spec.rb +++ b/spec/rubocop/cop/gitlab/policy_rule_boolean_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/policy_rule_boolean' -RSpec.describe RuboCop::Cop::Gitlab::PolicyRuleBoolean, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::PolicyRuleBoolean do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/predicate_memoization_spec.rb b/spec/rubocop/cop/gitlab/predicate_memoization_spec.rb index ebe984b189d..322c7c82968 100644 --- a/spec/rubocop/cop/gitlab/predicate_memoization_spec.rb +++ b/spec/rubocop/cop/gitlab/predicate_memoization_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/predicate_memoization' -RSpec.describe RuboCop::Cop::Gitlab::PredicateMemoization, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::PredicateMemoization do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/rails_logger_spec.rb b/spec/rubocop/cop/gitlab/rails_logger_spec.rb index 70d208b31ec..768da243b02 100644 --- a/spec/rubocop/cop/gitlab/rails_logger_spec.rb +++ b/spec/rubocop/cop/gitlab/rails_logger_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/rails_logger' -RSpec.describe RuboCop::Cop::Gitlab::RailsLogger, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::RailsLogger do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/gitlab/union_spec.rb b/spec/rubocop/cop/gitlab/union_spec.rb index 571dcc4eeb4..20364b1b901 100644 --- a/spec/rubocop/cop/gitlab/union_spec.rb +++ b/spec/rubocop/cop/gitlab/union_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/gitlab/union' -RSpec.describe RuboCop::Cop::Gitlab::Union, type: :rubocop do +RSpec.describe RuboCop::Cop::Gitlab::Union do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/graphql/authorize_types_spec.rb b/spec/rubocop/cop/graphql/authorize_types_spec.rb index df637a26ec5..a1b7a3f3a9b 100644 --- a/spec/rubocop/cop/graphql/authorize_types_spec.rb +++ b/spec/rubocop/cop/graphql/authorize_types_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require_relative '../../../../rubocop/cop/graphql/authorize_types' -RSpec.describe RuboCop::Cop::Graphql::AuthorizeTypes, type: :rubocop do +RSpec.describe RuboCop::Cop::Graphql::AuthorizeTypes do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/graphql/descriptions_spec.rb b/spec/rubocop/cop/graphql/descriptions_spec.rb index f4693057bcb..b44205b0920 100644 --- a/spec/rubocop/cop/graphql/descriptions_spec.rb +++ b/spec/rubocop/cop/graphql/descriptions_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/graphql/descriptions' -RSpec.describe RuboCop::Cop::Graphql::Descriptions, type: :rubocop do +RSpec.describe RuboCop::Cop::Graphql::Descriptions do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/graphql/gid_expected_type_spec.rb b/spec/rubocop/cop/graphql/gid_expected_type_spec.rb index a81af2aea5d..8fd7ae03748 100644 --- a/spec/rubocop/cop/graphql/gid_expected_type_spec.rb +++ b/spec/rubocop/cop/graphql/gid_expected_type_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require_relative '../../../../rubocop/cop/graphql/gid_expected_type' -RSpec.describe RuboCop::Cop::Graphql::GIDExpectedType, type: :rubocop do +RSpec.describe RuboCop::Cop::Graphql::GIDExpectedType do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/graphql/id_type_spec.rb b/spec/rubocop/cop/graphql/id_type_spec.rb index 8767412e282..6135c9fef43 100644 --- a/spec/rubocop/cop/graphql/id_type_spec.rb +++ b/spec/rubocop/cop/graphql/id_type_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require_relative '../../../../rubocop/cop/graphql/id_type' -RSpec.describe RuboCop::Cop::Graphql::IDType, type: :rubocop do +RSpec.describe RuboCop::Cop::Graphql::IDType do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/graphql/json_type_spec.rb b/spec/rubocop/cop/graphql/json_type_spec.rb index ac25e0feb69..6d9f86e44d2 100644 --- a/spec/rubocop/cop/graphql/json_type_spec.rb +++ b/spec/rubocop/cop/graphql/json_type_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/graphql/json_type' -RSpec.describe RuboCop::Cop::Graphql::JSONType, type: :rubocop do +RSpec.describe RuboCop::Cop::Graphql::JSONType do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/graphql/resolver_type_spec.rb b/spec/rubocop/cop/graphql/resolver_type_spec.rb index 4807d66396a..25213e30528 100644 --- a/spec/rubocop/cop/graphql/resolver_type_spec.rb +++ b/spec/rubocop/cop/graphql/resolver_type_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require_relative '../../../../rubocop/cop/graphql/resolver_type' -RSpec.describe RuboCop::Cop::Graphql::ResolverType, type: :rubocop do +RSpec.describe RuboCop::Cop::Graphql::ResolverType do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/group_public_or_visible_to_user_spec.rb b/spec/rubocop/cop/group_public_or_visible_to_user_spec.rb index 4e725deaafd..ac6c481a7c3 100644 --- a/spec/rubocop/cop/group_public_or_visible_to_user_spec.rb +++ b/spec/rubocop/cop/group_public_or_visible_to_user_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/group_public_or_visible_to_user' -RSpec.describe RuboCop::Cop::GroupPublicOrVisibleToUser, type: :rubocop do +RSpec.describe RuboCop::Cop::GroupPublicOrVisibleToUser do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/ignored_columns_spec.rb b/spec/rubocop/cop/ignored_columns_spec.rb index ec5499bbdff..38b4ac0bc1a 100644 --- a/spec/rubocop/cop/ignored_columns_spec.rb +++ b/spec/rubocop/cop/ignored_columns_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/ignored_columns' -RSpec.describe RuboCop::Cop::IgnoredColumns, type: :rubocop do +RSpec.describe RuboCop::Cop::IgnoredColumns do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/include_sidekiq_worker_spec.rb b/spec/rubocop/cop/include_sidekiq_worker_spec.rb index 33737babee5..f12652a1a58 100644 --- a/spec/rubocop/cop/include_sidekiq_worker_spec.rb +++ b/spec/rubocop/cop/include_sidekiq_worker_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/include_sidekiq_worker' -RSpec.describe RuboCop::Cop::IncludeSidekiqWorker, type: :rubocop do +RSpec.describe RuboCop::Cop::IncludeSidekiqWorker do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb b/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb index 767ed994542..47247006e42 100644 --- a/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb +++ b/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/inject_enterprise_edition_module' -RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule, type: :rubocop do +RSpec.describe RuboCop::Cop::InjectEnterpriseEditionModule do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/lint/last_keyword_argument_spec.rb b/spec/rubocop/cop/lint/last_keyword_argument_spec.rb index 5822bf74e8d..826c681a880 100644 --- a/spec/rubocop/cop/lint/last_keyword_argument_spec.rb +++ b/spec/rubocop/cop/lint/last_keyword_argument_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/lint/last_keyword_argument' -RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument, type: :rubocop do +RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument do include CopHelper subject(:cop) { described_class.new } @@ -38,6 +38,8 @@ RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument, type: :rubocop do - | DEPRECATION WARNING: /Users/tkuah/code/ee-gdk/gitlab/create_service.rb:1: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /Users/tkuah/code/ee-gdk/gitlab/user.rb:17: warning: The called method `call' is defined here + - | + DEPRECATION WARNING: /Users/tkuah/code/ee-gdk/gitlab/other_warning_type.rb:1: warning: Some other warning type YAML end @@ -62,7 +64,7 @@ RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument, type: :rubocop do allow(File).to receive(:read).and_return(create_spec_yaml, projects_spec_yaml) end - it 'registers an offense' do + it 'registers an offense for last keyword warning' do expect_offense(<<~SOURCE, 'create_service.rb') users.call(params) ^^^^^^ Using the last argument as keyword parameters is deprecated @@ -73,6 +75,12 @@ RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument, type: :rubocop do SOURCE end + it 'does not register an offense for other warning types' do + expect_no_offenses(<<~SOURCE, 'other_warning_type.rb') + users.call(params) + SOURCE + end + it 'registers an offense for the new method call' do expect_offense(<<~SOURCE, 'projects_spec.rb') Project.new(params) @@ -95,6 +103,23 @@ RSpec.describe RuboCop::Cop::Lint::LastKeywordArgument, type: :rubocop do SOURCE end + it 'registers an offense on the last non-block argument' do + expect_offense(<<~SOURCE, 'create_service.rb') + users.call(id, params, &block) + ^^^^^^ Using the last argument as keyword parameters is deprecated + SOURCE + + expect_correction(<<~SOURCE) + users.call(id, **params, &block) + SOURCE + end + + it 'does not register an offense if the only argument is a block argument' do + expect_no_offenses(<<~SOURCE, 'create_service.rb') + users.call(&block) + SOURCE + end + it 'registers an offense and corrects by converting splat to double splat' do expect_offense(<<~SOURCE, 'create_service.rb') users.call(id, *params) diff --git a/spec/rubocop/cop/migration/add_column_with_default_spec.rb b/spec/rubocop/cop/migration/add_column_with_default_spec.rb index 6deb092f235..cf476ae55d6 100644 --- a/spec/rubocop/cop/migration/add_column_with_default_spec.rb +++ b/spec/rubocop/cop/migration/add_column_with_default_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_column_with_default' -RSpec.describe RuboCop::Cop::Migration::AddColumnWithDefault, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddColumnWithDefault do include CopHelper let(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_columns_to_wide_tables_spec.rb b/spec/rubocop/cop/migration/add_columns_to_wide_tables_spec.rb index 6ae4fb21126..92863c45b1a 100644 --- a/spec/rubocop/cop/migration/add_columns_to_wide_tables_spec.rb +++ b/spec/rubocop/cop/migration/add_columns_to_wide_tables_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_columns_to_wide_tables' -RSpec.describe RuboCop::Cop::Migration::AddColumnsToWideTables, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddColumnsToWideTables do include CopHelper let(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb b/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb index aaf191a1b6b..25350ad1ecb 100644 --- a/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb +++ b/spec/rubocop/cop/migration/add_concurrent_foreign_key_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_concurrent_foreign_key' -RSpec.describe RuboCop::Cop::Migration::AddConcurrentForeignKey, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddConcurrentForeignKey do include CopHelper let(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_concurrent_index_spec.rb b/spec/rubocop/cop/migration/add_concurrent_index_spec.rb index cef5295830c..351283a230a 100644 --- a/spec/rubocop/cop/migration/add_concurrent_index_spec.rb +++ b/spec/rubocop/cop/migration/add_concurrent_index_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_concurrent_index' -RSpec.describe RuboCop::Cop::Migration::AddConcurrentIndex, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddConcurrentIndex do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_index_spec.rb b/spec/rubocop/cop/migration/add_index_spec.rb index 6bb78a7f3c7..1d083e9f2d2 100644 --- a/spec/rubocop/cop/migration/add_index_spec.rb +++ b/spec/rubocop/cop/migration/add_index_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_index' -RSpec.describe RuboCop::Cop::Migration::AddIndex, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddIndex do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb b/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb index 0bea7bd7a0c..97b9d0d1ee2 100644 --- a/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb +++ b/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_limit_to_text_columns' -RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_reference_spec.rb b/spec/rubocop/cop/migration/add_reference_spec.rb index fab70d74b55..6e229d3eefc 100644 --- a/spec/rubocop/cop/migration/add_reference_spec.rb +++ b/spec/rubocop/cop/migration/add_reference_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_reference' -RSpec.describe RuboCop::Cop::Migration::AddReference, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddReference do include CopHelper let(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/add_timestamps_spec.rb b/spec/rubocop/cop/migration/add_timestamps_spec.rb index c18b6b06ded..83570711ab9 100644 --- a/spec/rubocop/cop/migration/add_timestamps_spec.rb +++ b/spec/rubocop/cop/migration/add_timestamps_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/add_timestamps' -RSpec.describe RuboCop::Cop::Migration::AddTimestamps, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::AddTimestamps do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb b/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb index b769109057e..38ccf546b7c 100644 --- a/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb +++ b/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/complex_indexes_require_name' -RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/create_table_with_foreign_keys_spec.rb b/spec/rubocop/cop/migration/create_table_with_foreign_keys_spec.rb index eaaa50b8190..2159bad1490 100644 --- a/spec/rubocop/cop/migration/create_table_with_foreign_keys_spec.rb +++ b/spec/rubocop/cop/migration/create_table_with_foreign_keys_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/create_table_with_foreign_keys' -RSpec.describe RuboCop::Cop::Migration::CreateTableWithForeignKeys, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::CreateTableWithForeignKeys do include CopHelper let(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/datetime_spec.rb b/spec/rubocop/cop/migration/datetime_spec.rb index c5f6fd503ec..a3cccae21e0 100644 --- a/spec/rubocop/cop/migration/datetime_spec.rb +++ b/spec/rubocop/cop/migration/datetime_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/datetime' -RSpec.describe RuboCop::Cop::Migration::Datetime, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::Datetime do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/drop_table_spec.rb b/spec/rubocop/cop/migration/drop_table_spec.rb index 9ce5ee45b08..d783cb56203 100644 --- a/spec/rubocop/cop/migration/drop_table_spec.rb +++ b/spec/rubocop/cop/migration/drop_table_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/drop_table' -RSpec.describe RuboCop::Cop::Migration::DropTable, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::DropTable do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/hash_index_spec.rb b/spec/rubocop/cop/migration/hash_index_spec.rb index 3d26ea41d08..15f68eb990f 100644 --- a/spec/rubocop/cop/migration/hash_index_spec.rb +++ b/spec/rubocop/cop/migration/hash_index_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/hash_index' -RSpec.describe RuboCop::Cop::Migration::HashIndex, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::HashIndex do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/prevent_strings_spec.rb b/spec/rubocop/cop/migration/prevent_strings_spec.rb index 6882dca1926..560a485017a 100644 --- a/spec/rubocop/cop/migration/prevent_strings_spec.rb +++ b/spec/rubocop/cop/migration/prevent_strings_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/prevent_strings' -RSpec.describe RuboCop::Cop::Migration::PreventStrings, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::PreventStrings do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb b/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb index 76554d7446c..a25328a56a8 100644 --- a/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb +++ b/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/refer_to_index_by_name' -RSpec.describe RuboCop::Cop::Migration::ReferToIndexByName, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::ReferToIndexByName do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/remove_column_spec.rb b/spec/rubocop/cop/migration/remove_column_spec.rb index 7ef5556d8d7..4768093b10d 100644 --- a/spec/rubocop/cop/migration/remove_column_spec.rb +++ b/spec/rubocop/cop/migration/remove_column_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/remove_column' -RSpec.describe RuboCop::Cop::Migration::RemoveColumn, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::RemoveColumn do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/remove_concurrent_index_spec.rb b/spec/rubocop/cop/migration/remove_concurrent_index_spec.rb index f70febb571d..8da368d588c 100644 --- a/spec/rubocop/cop/migration/remove_concurrent_index_spec.rb +++ b/spec/rubocop/cop/migration/remove_concurrent_index_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/remove_concurrent_index' -RSpec.describe RuboCop::Cop::Migration::RemoveConcurrentIndex, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::RemoveConcurrentIndex do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/remove_index_spec.rb b/spec/rubocop/cop/migration/remove_index_spec.rb index cc82306a0f5..274c907ac41 100644 --- a/spec/rubocop/cop/migration/remove_index_spec.rb +++ b/spec/rubocop/cop/migration/remove_index_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/remove_index' -RSpec.describe RuboCop::Cop::Migration::RemoveIndex, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::RemoveIndex do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/safer_boolean_column_spec.rb b/spec/rubocop/cop/migration/safer_boolean_column_spec.rb index 72b817fde12..aa7bb58ab45 100644 --- a/spec/rubocop/cop/migration/safer_boolean_column_spec.rb +++ b/spec/rubocop/cop/migration/safer_boolean_column_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/safer_boolean_column' -RSpec.describe RuboCop::Cop::Migration::SaferBooleanColumn, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::SaferBooleanColumn do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/timestamps_spec.rb b/spec/rubocop/cop/migration/timestamps_spec.rb index 14b3cb36cf8..2f4154907d2 100644 --- a/spec/rubocop/cop/migration/timestamps_spec.rb +++ b/spec/rubocop/cop/migration/timestamps_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/timestamps' -RSpec.describe RuboCop::Cop::Migration::Timestamps, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::Timestamps do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/update_column_in_batches_spec.rb b/spec/rubocop/cop/migration/update_column_in_batches_spec.rb index 1d50d8c675e..8049cba12d0 100644 --- a/spec/rubocop/cop/migration/update_column_in_batches_spec.rb +++ b/spec/rubocop/cop/migration/update_column_in_batches_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/migration/update_column_in_batches' -RSpec.describe RuboCop::Cop::Migration::UpdateColumnInBatches, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::UpdateColumnInBatches do let(:cop) { described_class.new } let(:tmp_rails_root) { rails_root_join('tmp', 'rails_root') } let(:migration_code) do diff --git a/spec/rubocop/cop/migration/with_lock_retries_disallowed_method_spec.rb b/spec/rubocop/cop/migration/with_lock_retries_disallowed_method_spec.rb index 607daf0c9f0..814d87ea24b 100644 --- a/spec/rubocop/cop/migration/with_lock_retries_disallowed_method_spec.rb +++ b/spec/rubocop/cop/migration/with_lock_retries_disallowed_method_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/with_lock_retries_disallowed_method' -RSpec.describe RuboCop::Cop::Migration::WithLockRetriesDisallowedMethod, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::WithLockRetriesDisallowedMethod do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/migration/with_lock_retries_with_change_spec.rb b/spec/rubocop/cop/migration/with_lock_retries_with_change_spec.rb index 93b96f3a20e..f0be14c8ee9 100644 --- a/spec/rubocop/cop/migration/with_lock_retries_with_change_spec.rb +++ b/spec/rubocop/cop/migration/with_lock_retries_with_change_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/migration/with_lock_retries_with_change' -RSpec.describe RuboCop::Cop::Migration::WithLockRetriesWithChange, type: :rubocop do +RSpec.describe RuboCop::Cop::Migration::WithLockRetriesWithChange do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/performance/ar_count_each_spec.rb b/spec/rubocop/cop/performance/ar_count_each_spec.rb index 33b667dd52f..6242c7a4c5e 100644 --- a/spec/rubocop/cop/performance/ar_count_each_spec.rb +++ b/spec/rubocop/cop/performance/ar_count_each_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/performance/ar_count_each.rb' -RSpec.describe RuboCop::Cop::Performance::ARCountEach, type: :rubocop do +RSpec.describe RuboCop::Cop::Performance::ARCountEach do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb b/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb index 972f3c52153..3321d400ae1 100644 --- a/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb +++ b/spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/performance/ar_exists_and_present_blank.rb' -RSpec.describe RuboCop::Cop::Performance::ARExistsAndPresentBlank, type: :rubocop do +RSpec.describe RuboCop::Cop::Performance::ARExistsAndPresentBlank do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/performance/readlines_each_spec.rb b/spec/rubocop/cop/performance/readlines_each_spec.rb index 2f222f1dc00..c19426606f6 100644 --- a/spec/rubocop/cop/performance/readlines_each_spec.rb +++ b/spec/rubocop/cop/performance/readlines_each_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/performance/readlines_each' -RSpec.describe RuboCop::Cop::Performance::ReadlinesEach, type: :rubocop do +RSpec.describe RuboCop::Cop::Performance::ReadlinesEach do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/prefer_class_methods_over_module_spec.rb b/spec/rubocop/cop/prefer_class_methods_over_module_spec.rb index bed8d331209..dc665f9dd25 100644 --- a/spec/rubocop/cop/prefer_class_methods_over_module_spec.rb +++ b/spec/rubocop/cop/prefer_class_methods_over_module_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/prefer_class_methods_over_module' -RSpec.describe RuboCop::Cop::PreferClassMethodsOverModule, type: :rubocop do +RSpec.describe RuboCop::Cop::PreferClassMethodsOverModule do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/project_path_helper_spec.rb b/spec/rubocop/cop/project_path_helper_spec.rb index 0e5b0b10ae6..78a590b89f6 100644 --- a/spec/rubocop/cop/project_path_helper_spec.rb +++ b/spec/rubocop/cop/project_path_helper_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/project_path_helper' -RSpec.describe RuboCop::Cop::ProjectPathHelper, type: :rubocop do +RSpec.describe RuboCop::Cop::ProjectPathHelper do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/put_group_routes_under_scope_spec.rb b/spec/rubocop/cop/put_group_routes_under_scope_spec.rb index 888d1b6a2ba..46b50d7690b 100644 --- a/spec/rubocop/cop/put_group_routes_under_scope_spec.rb +++ b/spec/rubocop/cop/put_group_routes_under_scope_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../rubocop/cop/put_group_routes_under_scope' -RSpec.describe RuboCop::Cop::PutGroupRoutesUnderScope, type: :rubocop do +RSpec.describe RuboCop::Cop::PutGroupRoutesUnderScope do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/put_project_routes_under_scope_spec.rb b/spec/rubocop/cop/put_project_routes_under_scope_spec.rb index eebb7f3eb61..b0627af0e8b 100644 --- a/spec/rubocop/cop/put_project_routes_under_scope_spec.rb +++ b/spec/rubocop/cop/put_project_routes_under_scope_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../rubocop/cop/put_project_routes_under_scope' -RSpec.describe RuboCop::Cop::PutProjectRoutesUnderScope, type: :rubocop do +RSpec.describe RuboCop::Cop::PutProjectRoutesUnderScope do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb b/spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb index 484b5fad473..4876fcd5050 100644 --- a/spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb +++ b/spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/qa/ambiguous_page_object_name' -RSpec.describe RuboCop::Cop::QA::AmbiguousPageObjectName, type: :rubocop do +RSpec.describe RuboCop::Cop::QA::AmbiguousPageObjectName do include CopHelper let(:source_file) { 'qa/page.rb' } diff --git a/spec/rubocop/cop/qa/element_with_pattern_spec.rb b/spec/rubocop/cop/qa/element_with_pattern_spec.rb index 0e599701531..6289b1a7c97 100644 --- a/spec/rubocop/cop/qa/element_with_pattern_spec.rb +++ b/spec/rubocop/cop/qa/element_with_pattern_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/qa/element_with_pattern' -RSpec.describe RuboCop::Cop::QA::ElementWithPattern, type: :rubocop do +RSpec.describe RuboCop::Cop::QA::ElementWithPattern do include CopHelper let(:source_file) { 'qa/page.rb' } diff --git a/spec/rubocop/cop/rspec/any_instance_of_spec.rb b/spec/rubocop/cop/rspec/any_instance_of_spec.rb index 971e28853a3..42bb7d196a1 100644 --- a/spec/rubocop/cop/rspec/any_instance_of_spec.rb +++ b/spec/rubocop/cop/rspec/any_instance_of_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require_relative '../../../../rubocop/cop/rspec/any_instance_of' -RSpec.describe RuboCop::Cop::RSpec::AnyInstanceOf, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::AnyInstanceOf do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/be_success_matcher_spec.rb b/spec/rubocop/cop/rspec/be_success_matcher_spec.rb index b14cf39cbde..d49507c89b1 100644 --- a/spec/rubocop/cop/rspec/be_success_matcher_spec.rb +++ b/spec/rubocop/cop/rspec/be_success_matcher_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/rspec/be_success_matcher' -RSpec.describe RuboCop::Cop::RSpec::BeSuccessMatcher, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::BeSuccessMatcher do include CopHelper let(:source_file) { 'spec/foo_spec.rb' } diff --git a/spec/rubocop/cop/rspec/env_assignment_spec.rb b/spec/rubocop/cop/rspec/env_assignment_spec.rb index 72ad584dd6f..07afd30fc90 100644 --- a/spec/rubocop/cop/rspec/env_assignment_spec.rb +++ b/spec/rubocop/cop/rspec/env_assignment_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/rspec/env_assignment' -RSpec.describe RuboCop::Cop::RSpec::EnvAssignment, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::EnvAssignment do include CopHelper offense_call_single_quotes_key = %(ENV['FOO'] = 'bar').freeze diff --git a/spec/rubocop/cop/rspec/factories_in_migration_specs_spec.rb b/spec/rubocop/cop/rspec/factories_in_migration_specs_spec.rb index 1bb93402a5b..fe9cea47a43 100644 --- a/spec/rubocop/cop/rspec/factories_in_migration_specs_spec.rb +++ b/spec/rubocop/cop/rspec/factories_in_migration_specs_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/rspec/factories_in_migration_specs' -RSpec.describe RuboCop::Cop::RSpec::FactoriesInMigrationSpecs, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::FactoriesInMigrationSpecs do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/factory_bot/inline_association_spec.rb b/spec/rubocop/cop/rspec/factory_bot/inline_association_spec.rb index 70dbe086127..33fdaaee3c7 100644 --- a/spec/rubocop/cop/rspec/factory_bot/inline_association_spec.rb +++ b/spec/rubocop/cop/rspec/factory_bot/inline_association_spec.rb @@ -6,7 +6,7 @@ require 'rubocop' require_relative '../../../../../rubocop/cop/rspec/factory_bot/inline_association' -RSpec.describe RuboCop::Cop::RSpec::FactoryBot::InlineAssociation, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::FactoryBot::InlineAssociation do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/htt_party_basic_auth_spec.rb b/spec/rubocop/cop/rspec/htt_party_basic_auth_spec.rb index 8c3703a488a..6e9e436602c 100644 --- a/spec/rubocop/cop/rspec/htt_party_basic_auth_spec.rb +++ b/spec/rubocop/cop/rspec/htt_party_basic_auth_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require_relative '../../../../rubocop/cop/rspec/httparty_basic_auth' -RSpec.describe RuboCop::Cop::RSpec::HTTPartyBasicAuth, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::HTTPartyBasicAuth do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/modify_sidekiq_middleware_spec.rb b/spec/rubocop/cop/rspec/modify_sidekiq_middleware_spec.rb index ca47bba4264..d9e3ca5741c 100644 --- a/spec/rubocop/cop/rspec/modify_sidekiq_middleware_spec.rb +++ b/spec/rubocop/cop/rspec/modify_sidekiq_middleware_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/rspec/modify_sidekiq_middleware' -RSpec.describe RuboCop::Cop::RSpec::ModifySidekiqMiddleware, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::ModifySidekiqMiddleware do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/timecop_freeze_spec.rb b/spec/rubocop/cop/rspec/timecop_freeze_spec.rb index 3809431a2fc..b1cf82492e4 100644 --- a/spec/rubocop/cop/rspec/timecop_freeze_spec.rb +++ b/spec/rubocop/cop/rspec/timecop_freeze_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/rspec/timecop_freeze' -RSpec.describe RuboCop::Cop::RSpec::TimecopFreeze, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::TimecopFreeze do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/timecop_travel_spec.rb b/spec/rubocop/cop/rspec/timecop_travel_spec.rb index 25a8127d40e..2ee8bfe9ad7 100644 --- a/spec/rubocop/cop/rspec/timecop_travel_spec.rb +++ b/spec/rubocop/cop/rspec/timecop_travel_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/rspec/timecop_travel' -RSpec.describe RuboCop::Cop::RSpec::TimecopTravel, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::TimecopTravel do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/top_level_describe_path_spec.rb b/spec/rubocop/cop/rspec/top_level_describe_path_spec.rb index 92a76bde243..4936936836d 100644 --- a/spec/rubocop/cop/rspec/top_level_describe_path_spec.rb +++ b/spec/rubocop/cop/rspec/top_level_describe_path_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/rspec/top_level_describe_path' -RSpec.describe RuboCop::Cop::RSpec::TopLevelDescribePath, type: :rubocop do +RSpec.describe RuboCop::Cop::RSpec::TopLevelDescribePath do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/rspec/web_mock_enable_spec.rb b/spec/rubocop/cop/rspec/web_mock_enable_spec.rb new file mode 100644 index 00000000000..61a85064a61 --- /dev/null +++ b/spec/rubocop/cop/rspec/web_mock_enable_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'fast_spec_helper' + +require_relative '../../../../rubocop/cop/rspec/web_mock_enable' + +RSpec.describe RuboCop::Cop::RSpec::WebMockEnable do + subject(:cop) { described_class.new } + + context 'when calling WebMock.disable_net_connect!' do + it 'registers an offence and autocorrects it' do + expect_offense(<<~RUBY) + WebMock.disable_net_connect!(allow_localhost: true) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use webmock_enable! instead of calling WebMock.disable_net_connect! directly. + RUBY + + expect_correction(<<~RUBY) + webmock_enable! + RUBY + end + end +end diff --git a/spec/rubocop/cop/ruby_interpolation_in_translation_spec.rb b/spec/rubocop/cop/ruby_interpolation_in_translation_spec.rb index 938ddc7fb6a..a6a44b3fa68 100644 --- a/spec/rubocop/cop/ruby_interpolation_in_translation_spec.rb +++ b/spec/rubocop/cop/ruby_interpolation_in_translation_spec.rb @@ -9,7 +9,7 @@ require_relative '../../../rubocop/cop/ruby_interpolation_in_translation' # Disabling interpolation check as we deliberately want to have #{} in strings. # rubocop:disable Lint/InterpolationCheck -RSpec.describe RuboCop::Cop::RubyInterpolationInTranslation, type: :rubocop do +RSpec.describe RuboCop::Cop::RubyInterpolationInTranslation do subject(:cop) { described_class.new } it 'does not add an offence for a regular messages' do diff --git a/spec/rubocop/cop/safe_params_spec.rb b/spec/rubocop/cop/safe_params_spec.rb index c4f683a41bf..c8f6768c4bb 100644 --- a/spec/rubocop/cop/safe_params_spec.rb +++ b/spec/rubocop/cop/safe_params_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/safe_params' -RSpec.describe RuboCop::Cop::SafeParams, type: :rubocop do +RSpec.describe RuboCop::Cop::SafeParams do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/scalability/bulk_perform_with_context_spec.rb b/spec/rubocop/cop/scalability/bulk_perform_with_context_spec.rb index 48964ab76e0..6e526f7ad8f 100644 --- a/spec/rubocop/cop/scalability/bulk_perform_with_context_spec.rb +++ b/spec/rubocop/cop/scalability/bulk_perform_with_context_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/scalability/bulk_perform_with_context' -RSpec.describe RuboCop::Cop::Scalability::BulkPerformWithContext, type: :rubocop do +RSpec.describe RuboCop::Cop::Scalability::BulkPerformWithContext do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/scalability/cron_worker_context_spec.rb b/spec/rubocop/cop/scalability/cron_worker_context_spec.rb index 4b4ee7258f1..4699e06e9cf 100644 --- a/spec/rubocop/cop/scalability/cron_worker_context_spec.rb +++ b/spec/rubocop/cop/scalability/cron_worker_context_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/scalability/cron_worker_context' -RSpec.describe RuboCop::Cop::Scalability::CronWorkerContext, type: :rubocop do +RSpec.describe RuboCop::Cop::Scalability::CronWorkerContext do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/scalability/file_uploads_spec.rb b/spec/rubocop/cop/scalability/file_uploads_spec.rb index ed826728681..78ff7fea55c 100644 --- a/spec/rubocop/cop/scalability/file_uploads_spec.rb +++ b/spec/rubocop/cop/scalability/file_uploads_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/scalability/file_uploads' -RSpec.describe RuboCop::Cop::Scalability::FileUploads, type: :rubocop do +RSpec.describe RuboCop::Cop::Scalability::FileUploads do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/scalability/idempotent_worker_spec.rb b/spec/rubocop/cop/scalability/idempotent_worker_spec.rb index 9197cc954f5..666122a9de4 100644 --- a/spec/rubocop/cop/scalability/idempotent_worker_spec.rb +++ b/spec/rubocop/cop/scalability/idempotent_worker_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'rubocop' require_relative '../../../../rubocop/cop/scalability/idempotent_worker' -RSpec.describe RuboCop::Cop::Scalability::IdempotentWorker, type: :rubocop do +RSpec.describe RuboCop::Cop::Scalability::IdempotentWorker do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/sidekiq_options_queue_spec.rb b/spec/rubocop/cop/sidekiq_options_queue_spec.rb index e76265d426c..306cbcf62b5 100644 --- a/spec/rubocop/cop/sidekiq_options_queue_spec.rb +++ b/spec/rubocop/cop/sidekiq_options_queue_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../rubocop/cop/sidekiq_options_queue' -RSpec.describe RuboCop::Cop::SidekiqOptionsQueue, type: :rubocop do +RSpec.describe RuboCop::Cop::SidekiqOptionsQueue do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/static_translation_definition_spec.rb b/spec/rubocop/cop/static_translation_definition_spec.rb index f3185def3d7..8a38a318999 100644 --- a/spec/rubocop/cop/static_translation_definition_spec.rb +++ b/spec/rubocop/cop/static_translation_definition_spec.rb @@ -7,7 +7,7 @@ require 'rspec-parameterized' require_relative '../../../rubocop/cop/static_translation_definition' -RSpec.describe RuboCop::Cop::StaticTranslationDefinition, type: :rubocop do +RSpec.describe RuboCop::Cop::StaticTranslationDefinition do include CopHelper using RSpec::Parameterized::TableSyntax diff --git a/spec/rubocop/cop/usage_data/distinct_count_by_large_foreign_key_spec.rb b/spec/rubocop/cop/usage_data/distinct_count_by_large_foreign_key_spec.rb index 8b6a2eac349..1c90df798a5 100644 --- a/spec/rubocop/cop/usage_data/distinct_count_by_large_foreign_key_spec.rb +++ b/spec/rubocop/cop/usage_data/distinct_count_by_large_foreign_key_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/usage_data/distinct_count_by_large_foreign_key' -RSpec.describe RuboCop::Cop::UsageData::DistinctCountByLargeForeignKey, type: :rubocop do +RSpec.describe RuboCop::Cop::UsageData::DistinctCountByLargeForeignKey do include CopHelper let(:allowed_foreign_keys) { [:author_id, :user_id, :'merge_requests.target_project_id'] } diff --git a/spec/rubocop/cop/usage_data/large_table_spec.rb b/spec/rubocop/cop/usage_data/large_table_spec.rb index de6fb9c17e2..638e8c67dc8 100644 --- a/spec/rubocop/cop/usage_data/large_table_spec.rb +++ b/spec/rubocop/cop/usage_data/large_table_spec.rb @@ -7,7 +7,7 @@ require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/usage_data/large_table' -RSpec.describe RuboCop::Cop::UsageData::LargeTable, type: :rubocop do +RSpec.describe RuboCop::Cop::UsageData::LargeTable do include CopHelper let(:large_tables) { %i[Rails Time] } diff --git a/spec/rubocop/qa_helpers_spec.rb b/spec/rubocop/qa_helpers_spec.rb index 786b9c78952..051817903a8 100644 --- a/spec/rubocop/qa_helpers_spec.rb +++ b/spec/rubocop/qa_helpers_spec.rb @@ -5,7 +5,7 @@ require 'rubocop' require 'parser/current' require_relative '../../rubocop/qa_helpers' -RSpec.describe RuboCop::QAHelpers, type: :rubocop do +RSpec.describe RuboCop::QAHelpers do def parse_source(source, path = 'foo.rb') buffer = Parser::Source::Buffer.new(path) buffer.source = source -- cgit v1.2.3