diff --git a/spec/rubocop/cop/bundler/duplicated_gem_spec.rb b/spec/rubocop/cop/bundler/duplicated_gem_spec.rb index ebe7598c168..b3e65e9ef71 100644 --- a/spec/rubocop/cop/bundler/duplicated_gem_spec.rb +++ b/spec/rubocop/cop/bundler/duplicated_gem_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Bundler::DuplicatedGem, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Include' => ['**/Gemfile'] } } context 'when investigating Ruby files' do diff --git a/spec/rubocop/cop/bundler/gem_comment_spec.rb b/spec/rubocop/cop/bundler/gem_comment_spec.rb index dafb4da18e0..9d964d39006 100644 --- a/spec/rubocop/cop/bundler/gem_comment_spec.rb +++ b/spec/rubocop/cop/bundler/gem_comment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Bundler::GemComment, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'Include' => ['**/Gemfile'], diff --git a/spec/rubocop/cop/bundler/ordered_gems_spec.rb b/spec/rubocop/cop/bundler/ordered_gems_spec.rb index 1ff35cff750..7d800adf745 100644 --- a/spec/rubocop/cop/bundler/ordered_gems_spec.rb +++ b/spec/rubocop/cop/bundler/ordered_gems_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Bundler::OrderedGems, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'TreatCommentsAsGroupSeparators' => treat_comments_as_group_separators, diff --git a/spec/rubocop/cop/gemspec/ordered_dependencies_spec.rb b/spec/rubocop/cop/gemspec/ordered_dependencies_spec.rb index 027ee8cf5fc..a43490b48bf 100644 --- a/spec/rubocop/cop/gemspec/ordered_dependencies_spec.rb +++ b/spec/rubocop/cop/gemspec/ordered_dependencies_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Gemspec::OrderedDependencies, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'TreatCommentsAsGroupSeparators' => treat_comments_as_group_separators, diff --git a/spec/rubocop/cop/gemspec/required_ruby_version_spec.rb b/spec/rubocop/cop/gemspec/required_ruby_version_spec.rb index 24ee2a44cca..54b976fd34d 100644 --- a/spec/rubocop/cop/gemspec/required_ruby_version_spec.rb +++ b/spec/rubocop/cop/gemspec/required_ruby_version_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Gemspec::RequiredRubyVersion, :config do - subject(:cop) { described_class.new(config) } - context 'target ruby version > 2.7', :ruby27 do it 'registers an offense when `required_ruby_version` is lower than ' \ '`TargetRubyVersion`' do diff --git a/spec/rubocop/cop/gemspec/ruby_version_globals_usage_spec.rb b/spec/rubocop/cop/gemspec/ruby_version_globals_usage_spec.rb index 40d4cf976c7..8f6f0e671b8 100644 --- a/spec/rubocop/cop/gemspec/ruby_version_globals_usage_spec.rb +++ b/spec/rubocop/cop/gemspec/ruby_version_globals_usage_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense when using `RUBY_VERSION`' do expect_offense(<<~RUBY, '/path/to/foo.gemspec') Gem::Specification.new do |spec| diff --git a/spec/rubocop/cop/layout/assignment_indentation_spec.rb b/spec/rubocop/cop/layout/assignment_indentation_spec.rb index b1133f5434f..01c9dc628ba 100644 --- a/spec/rubocop/cop/layout/assignment_indentation_spec.rb +++ b/spec/rubocop/cop/layout/assignment_indentation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::AssignmentIndentation, :config do - subject(:cop) { described_class.new(config) } - let(:config) do RuboCop::Config.new('Layout/AssignmentIndentation' => { 'IndentationWidth' => cop_indent diff --git a/spec/rubocop/cop/layout/block_alignment_spec.rb b/spec/rubocop/cop/layout/block_alignment_spec.rb index 768f8e3edfc..88ff4c36ecd 100644 --- a/spec/rubocop/cop/layout/block_alignment_spec.rb +++ b/spec/rubocop/cop/layout/block_alignment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::BlockAlignment, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'EnforcedStyleAlignWith' => 'either' } end diff --git a/spec/rubocop/cop/layout/class_structure_spec.rb b/spec/rubocop/cop/layout/class_structure_spec.rb index ae21ad743bb..1fbbed9777c 100644 --- a/spec/rubocop/cop/layout/class_structure_spec.rb +++ b/spec/rubocop/cop/layout/class_structure_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::ClassStructure, :config do - subject(:cop) { described_class.new(config) } - let(:config) do RuboCop::Config.new( 'Layout/ClassStructure' => { diff --git a/spec/rubocop/cop/layout/def_end_alignment_spec.rb b/spec/rubocop/cop/layout/def_end_alignment_spec.rb index 96c85a92c96..1bc950a3cfc 100644 --- a/spec/rubocop/cop/layout/def_end_alignment_spec.rb +++ b/spec/rubocop/cop/layout/def_end_alignment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::DefEndAlignment, :config do - subject(:cop) { described_class.new(config) } - let(:source) do <<~RUBY foo def a diff --git a/spec/rubocop/cop/layout/dot_position_spec.rb b/spec/rubocop/cop/layout/dot_position_spec.rb index 9076ca0ca42..94fdb41c88e 100644 --- a/spec/rubocop/cop/layout/dot_position_spec.rb +++ b/spec/rubocop/cop/layout/dot_position_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::DotPosition, :config do - subject(:cop) { described_class.new(config) } - context 'Leading dots style' do let(:cop_config) { { 'EnforcedStyle' => 'leading' } } diff --git a/spec/rubocop/cop/layout/empty_comment_spec.rb b/spec/rubocop/cop/layout/empty_comment_spec.rb index f1547a84ef2..0de1caa3ef4 100644 --- a/spec/rubocop/cop/layout/empty_comment_spec.rb +++ b/spec/rubocop/cop/layout/empty_comment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyComment, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'AllowBorderComment' => true, 'AllowMarginComment' => true } end diff --git a/spec/rubocop/cop/layout/empty_line_between_defs_spec.rb b/spec/rubocop/cop/layout/empty_line_between_defs_spec.rb index ac931e82f54..bffd802a9ef 100644 --- a/spec/rubocop/cop/layout/empty_line_between_defs_spec.rb +++ b/spec/rubocop/cop/layout/empty_line_between_defs_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyLineBetweenDefs, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowAdjacentOneLineDefs' => false } } it 'finds offenses in inner classes' do diff --git a/spec/rubocop/cop/layout/empty_lines_around_access_modifier_spec.rb b/spec/rubocop/cop/layout/empty_lines_around_access_modifier_spec.rb index 4498d59b569..140a91a01d0 100644 --- a/spec/rubocop/cop/layout/empty_lines_around_access_modifier_spec.rb +++ b/spec/rubocop/cop/layout/empty_lines_around_access_modifier_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier, :config do - subject(:cop) { described_class.new(config) } - context 'EnforcedStyle is `around`' do let(:cop_config) { { 'EnforcedStyle' => 'around' } } diff --git a/spec/rubocop/cop/layout/empty_lines_around_arguments_spec.rb b/spec/rubocop/cop/layout/empty_lines_around_arguments_spec.rb index 42a7ea32763..b3d71410f37 100644 --- a/spec/rubocop/cop/layout/empty_lines_around_arguments_spec.rb +++ b/spec/rubocop/cop/layout/empty_lines_around_arguments_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyLinesAroundArguments, :config do - subject(:cop) { described_class.new(config) } - context 'when extra lines' do it 'registers offense for empty line before arg' do inspect_source(<<~RUBY) diff --git a/spec/rubocop/cop/layout/empty_lines_around_block_body_spec.rb b/spec/rubocop/cop/layout/empty_lines_around_block_body_spec.rb index 7c00e7f5404..eadee755313 100644 --- a/spec/rubocop/cop/layout/empty_lines_around_block_body_spec.rb +++ b/spec/rubocop/cop/layout/empty_lines_around_block_body_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyLinesAroundBlockBody, :config do - subject(:cop) { described_class.new(config) } - # Test blocks using both {} and do..end [%w[{ }], %w[do end]].each do |open, close| context "when EnforcedStyle is no_empty_lines for #{open} #{close} block" do diff --git a/spec/rubocop/cop/layout/empty_lines_around_class_body_spec.rb b/spec/rubocop/cop/layout/empty_lines_around_class_body_spec.rb index f4b76f98228..ca292273d9f 100644 --- a/spec/rubocop/cop/layout/empty_lines_around_class_body_spec.rb +++ b/spec/rubocop/cop/layout/empty_lines_around_class_body_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyLinesAroundClassBody, :config do - subject(:cop) { described_class.new(config) } - let(:extra_begin) { 'Extra empty line detected at class body beginning.' } let(:extra_end) { 'Extra empty line detected at class body end.' } let(:missing_begin) { 'Empty line missing at class body beginning.' } diff --git a/spec/rubocop/cop/layout/empty_lines_around_module_body_spec.rb b/spec/rubocop/cop/layout/empty_lines_around_module_body_spec.rb index 8b1de597e11..301b11a4d38 100644 --- a/spec/rubocop/cop/layout/empty_lines_around_module_body_spec.rb +++ b/spec/rubocop/cop/layout/empty_lines_around_module_body_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EmptyLinesAroundModuleBody, :config do - subject(:cop) { described_class.new(config) } - let(:extra_begin) { 'Extra empty line detected at module body beginning.' } let(:extra_end) { 'Extra empty line detected at module body end.' } let(:missing_begin) { 'Empty line missing at module body beginning.' } diff --git a/spec/rubocop/cop/layout/end_alignment_spec.rb b/spec/rubocop/cop/layout/end_alignment_spec.rb index e39f9417b91..b68c2ae8d34 100644 --- a/spec/rubocop/cop/layout/end_alignment_spec.rb +++ b/spec/rubocop/cop/layout/end_alignment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EndAlignment, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'EnforcedStyleAlignWith' => 'keyword', 'AutoCorrect' => true } end diff --git a/spec/rubocop/cop/layout/end_of_line_spec.rb b/spec/rubocop/cop/layout/end_of_line_spec.rb index db2fbbccf3b..5f974a2d3e0 100644 --- a/spec/rubocop/cop/layout/end_of_line_spec.rb +++ b/spec/rubocop/cop/layout/end_of_line_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::EndOfLine, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'all configurations' do it 'accepts an empty file' do inspect_source_file('') diff --git a/spec/rubocop/cop/layout/extra_spacing_spec.rb b/spec/rubocop/cop/layout/extra_spacing_spec.rb index 3635ea10c33..b1555c73581 100644 --- a/spec/rubocop/cop/layout/extra_spacing_spec.rb +++ b/spec/rubocop/cop/layout/extra_spacing_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::ExtraSpacing, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'common behavior' do it 'registers an offense and corrects alignment with token ' \ 'not preceded by space' do diff --git a/spec/rubocop/cop/layout/first_argument_indentation_spec.rb b/spec/rubocop/cop/layout/first_argument_indentation_spec.rb index d45591692d6..b04347c4fb6 100644 --- a/spec/rubocop/cop/layout/first_argument_indentation_spec.rb +++ b/spec/rubocop/cop/layout/first_argument_indentation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::FirstArgumentIndentation, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'EnforcedStyle' => style } end diff --git a/spec/rubocop/cop/layout/first_parameter_indentation_spec.rb b/spec/rubocop/cop/layout/first_parameter_indentation_spec.rb index 5e6905d2a08..4d631a97a4b 100644 --- a/spec/rubocop/cop/layout/first_parameter_indentation_spec.rb +++ b/spec/rubocop/cop/layout/first_parameter_indentation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::FirstParameterIndentation, :config do - subject(:cop) { described_class.new(config) } - let(:config) do supported_styles = { 'SupportedStyles' => %w[consistent align_parentheses] diff --git a/spec/rubocop/cop/layout/hash_alignment_spec.rb b/spec/rubocop/cop/layout/hash_alignment_spec.rb index 266cc06ae7b..e5588ca7e22 100644 --- a/spec/rubocop/cop/layout/hash_alignment_spec.rb +++ b/spec/rubocop/cop/layout/hash_alignment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::HashAlignment, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'EnforcedHashRocketStyle' => 'key', diff --git a/spec/rubocop/cop/layout/heredoc_indentation_spec.rb b/spec/rubocop/cop/layout/heredoc_indentation_spec.rb index ed2e61e656a..ba018f5b869 100644 --- a/spec/rubocop/cop/layout/heredoc_indentation_spec.rb +++ b/spec/rubocop/cop/layout/heredoc_indentation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::HeredocIndentation, :config do - subject(:cop) { described_class.new(config) } - let(:allow_heredoc) { true } let(:other_cops) do { diff --git a/spec/rubocop/cop/layout/indentation_consistency_spec.rb b/spec/rubocop/cop/layout/indentation_consistency_spec.rb index 0c80af6cfbe..c4320c2445f 100644 --- a/spec/rubocop/cop/layout/indentation_consistency_spec.rb +++ b/spec/rubocop/cop/layout/indentation_consistency_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::IndentationConsistency, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'normal' } } context 'with top-level code' do diff --git a/spec/rubocop/cop/layout/leading_comment_space_spec.rb b/spec/rubocop/cop/layout/leading_comment_space_spec.rb index 3b30f5e4452..77d1a0ee9d4 100644 --- a/spec/rubocop/cop/layout/leading_comment_space_spec.rb +++ b/spec/rubocop/cop/layout/leading_comment_space_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::LeadingCommentSpace, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense and corrects comment without leading space' do expect_offense(<<~RUBY) #missing space diff --git a/spec/rubocop/cop/layout/leading_empty_lines_spec.rb b/spec/rubocop/cop/layout/leading_empty_lines_spec.rb index 651a5b331b8..e0ed5a1c4fb 100644 --- a/spec/rubocop/cop/layout/leading_empty_lines_spec.rb +++ b/spec/rubocop/cop/layout/leading_empty_lines_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::LeadingEmptyLines, :config do - subject(:cop) { described_class.new(config) } - it 'allows an empty input' do expect_no_offenses('') end diff --git a/spec/rubocop/cop/layout/line_length_spec.rb b/spec/rubocop/cop/layout/line_length_spec.rb index b35e6cc25a8..a6e76ba0e6e 100644 --- a/spec/rubocop/cop/layout/line_length_spec.rb +++ b/spec/rubocop/cop/layout/line_length_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::LineLength, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Max' => 80, 'IgnoredPatterns' => nil } } let(:config) do diff --git a/spec/rubocop/cop/layout/multiline_array_brace_layout_spec.rb b/spec/rubocop/cop/layout/multiline_array_brace_layout_spec.rb index 6de159d7e53..8715583ba84 100644 --- a/spec/rubocop/cop/layout/multiline_array_brace_layout_spec.rb +++ b/spec/rubocop/cop/layout/multiline_array_brace_layout_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::MultilineArrayBraceLayout, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'symmetrical' } } it 'ignores implicit arrays' do diff --git a/spec/rubocop/cop/layout/multiline_assignment_layout_spec.rb b/spec/rubocop/cop/layout/multiline_assignment_layout_spec.rb index 1643b47183b..91d62e35df6 100644 --- a/spec/rubocop/cop/layout/multiline_assignment_layout_spec.rb +++ b/spec/rubocop/cop/layout/multiline_assignment_layout_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::MultilineAssignmentLayout, :config do - subject(:cop) { described_class.new(config) } - let(:supported_types) { %w[if] } let(:cop_config) do diff --git a/spec/rubocop/cop/layout/multiline_hash_brace_layout_spec.rb b/spec/rubocop/cop/layout/multiline_hash_brace_layout_spec.rb index 24530867715..9dff8e9e7d1 100644 --- a/spec/rubocop/cop/layout/multiline_hash_brace_layout_spec.rb +++ b/spec/rubocop/cop/layout/multiline_hash_brace_layout_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::MultilineHashBraceLayout, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'symmetrical' } } it 'ignores implicit hashes' do diff --git a/spec/rubocop/cop/layout/multiline_method_call_brace_layout_spec.rb b/spec/rubocop/cop/layout/multiline_method_call_brace_layout_spec.rb index 574c44562f9..961ea1be578 100644 --- a/spec/rubocop/cop/layout/multiline_method_call_brace_layout_spec.rb +++ b/spec/rubocop/cop/layout/multiline_method_call_brace_layout_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::MultilineMethodCallBraceLayout, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'symmetrical' } } it 'ignores implicit calls' do diff --git a/spec/rubocop/cop/layout/multiline_method_definition_brace_layout_spec.rb b/spec/rubocop/cop/layout/multiline_method_definition_brace_layout_spec.rb index af3b15ea7da..6f340f3d69b 100644 --- a/spec/rubocop/cop/layout/multiline_method_definition_brace_layout_spec.rb +++ b/spec/rubocop/cop/layout/multiline_method_definition_brace_layout_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'symmetrical' } } it 'ignores implicit defs' do diff --git a/spec/rubocop/cop/layout/rescue_ensure_alignment_spec.rb b/spec/rubocop/cop/layout/rescue_ensure_alignment_spec.rb index e72b6a98f4c..2b4afb4f3d1 100644 --- a/spec/rubocop/cop/layout/rescue_ensure_alignment_spec.rb +++ b/spec/rubocop/cop/layout/rescue_ensure_alignment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::RescueEnsureAlignment, :config do - subject(:cop) { described_class.new(config) } - it 'accepts the modifier form' do expect_no_offenses('test rescue nil') end diff --git a/spec/rubocop/cop/layout/space_around_block_parameters_spec.rb b/spec/rubocop/cop/layout/space_around_block_parameters_spec.rb index a0ed39eca69..8ba4f292ea0 100644 --- a/spec/rubocop/cop/layout/space_around_block_parameters_spec.rb +++ b/spec/rubocop/cop/layout/space_around_block_parameters_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceAroundBlockParameters, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'common behavior' do it 'accepts an empty block' do expect_no_offenses('{}.each {}') diff --git a/spec/rubocop/cop/layout/space_around_equals_in_parameter_default_spec.rb b/spec/rubocop/cop/layout/space_around_equals_in_parameter_default_spec.rb index 0322a95fb8a..8a3c4d9377c 100644 --- a/spec/rubocop/cop/layout/space_around_equals_in_parameter_default_spec.rb +++ b/spec/rubocop/cop/layout/space_around_equals_in_parameter_default_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is space' do let(:cop_config) { { 'EnforcedStyle' => 'space' } } diff --git a/spec/rubocop/cop/layout/space_before_block_braces_spec.rb b/spec/rubocop/cop/layout/space_before_block_braces_spec.rb index 76cb26cd7c4..2e306fd490a 100644 --- a/spec/rubocop/cop/layout/space_before_block_braces_spec.rb +++ b/spec/rubocop/cop/layout/space_before_block_braces_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceBeforeBlockBraces, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'space' } } context 'when EnforcedStyle is space' do diff --git a/spec/rubocop/cop/layout/space_before_first_arg_spec.rb b/spec/rubocop/cop/layout/space_before_first_arg_spec.rb index 737ee5c75d7..649bce8b6a5 100644 --- a/spec/rubocop/cop/layout/space_before_first_arg_spec.rb +++ b/spec/rubocop/cop/layout/space_before_first_arg_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceBeforeFirstArg, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowForAlignment' => true } } context 'for method calls without parentheses' do diff --git a/spec/rubocop/cop/layout/space_in_lambda_literal_spec.rb b/spec/rubocop/cop/layout/space_in_lambda_literal_spec.rb index fdd1b051910..6a01606de40 100644 --- a/spec/rubocop/cop/layout/space_in_lambda_literal_spec.rb +++ b/spec/rubocop/cop/layout/space_in_lambda_literal_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceInLambdaLiteral, :config do - subject(:cop) { described_class.new(config) } - context 'when configured to enforce spaces' do let(:cop_config) { { 'EnforcedStyle' => 'require_space' } } diff --git a/spec/rubocop/cop/layout/space_inside_array_literal_brackets_spec.rb b/spec/rubocop/cop/layout/space_inside_array_literal_brackets_spec.rb index b798e4d76ab..84f4fac046d 100644 --- a/spec/rubocop/cop/layout/space_inside_array_literal_brackets_spec.rb +++ b/spec/rubocop/cop/layout/space_inside_array_literal_brackets_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets, :config do - subject(:cop) { described_class.new(config) } - it 'does not register offense for any kind of reference brackets' do expect_no_offenses(<<~RUBY) a[1] diff --git a/spec/rubocop/cop/layout/space_inside_hash_literal_braces_spec.rb b/spec/rubocop/cop/layout/space_inside_hash_literal_braces_spec.rb index b8651b5cc4d..4e62378ad1b 100644 --- a/spec/rubocop/cop/layout/space_inside_hash_literal_braces_spec.rb +++ b/spec/rubocop/cop/layout/space_inside_hash_literal_braces_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnforcedStyle' => 'space' } } context 'with space inside empty braces not allowed' do diff --git a/spec/rubocop/cop/layout/space_inside_parens_spec.rb b/spec/rubocop/cop/layout/space_inside_parens_spec.rb index 39d43de62a9..fc9e48cdeca 100644 --- a/spec/rubocop/cop/layout/space_inside_parens_spec.rb +++ b/spec/rubocop/cop/layout/space_inside_parens_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceInsideParens, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is no_space' do let(:cop_config) { { 'EnforcedStyle' => 'no_space' } } diff --git a/spec/rubocop/cop/layout/space_inside_reference_brackets_spec.rb b/spec/rubocop/cop/layout/space_inside_reference_brackets_spec.rb index e522dfa79bb..aa82ff2c340 100644 --- a/spec/rubocop/cop/layout/space_inside_reference_brackets_spec.rb +++ b/spec/rubocop/cop/layout/space_inside_reference_brackets_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceInsideReferenceBrackets, :config do - subject(:cop) { described_class.new(config) } - context 'with space inside empty brackets not allowed' do let(:cop_config) { { 'EnforcedStyleForEmptyBrackets' => 'no_space' } } diff --git a/spec/rubocop/cop/layout/space_inside_string_interpolation_spec.rb b/spec/rubocop/cop/layout/space_inside_string_interpolation_spec.rb index 917cf39309d..50f5d28f96e 100644 --- a/spec/rubocop/cop/layout/space_inside_string_interpolation_spec.rb +++ b/spec/rubocop/cop/layout/space_inside_string_interpolation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::SpaceInsideStringInterpolation, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is no_space' do let(:cop_config) { { 'EnforcedStyle' => 'no_space' } } diff --git a/spec/rubocop/cop/layout/trailing_empty_lines_spec.rb b/spec/rubocop/cop/layout/trailing_empty_lines_spec.rb index bfc1224677e..70fc20b91be 100644 --- a/spec/rubocop/cop/layout/trailing_empty_lines_spec.rb +++ b/spec/rubocop/cop/layout/trailing_empty_lines_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::TrailingEmptyLines, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is final_newline' do let(:cop_config) { { 'EnforcedStyle' => 'final_newline' } } diff --git a/spec/rubocop/cop/layout/trailing_whitespace_spec.rb b/spec/rubocop/cop/layout/trailing_whitespace_spec.rb index 70e972d2479..53f67120302 100644 --- a/spec/rubocop/cop/layout/trailing_whitespace_spec.rb +++ b/spec/rubocop/cop/layout/trailing_whitespace_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Layout::TrailingWhitespace, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowInHeredoc' => false } } it 'registers an offense for a line ending with space' do diff --git a/spec/rubocop/cop/lint/assignment_in_condition_spec.rb b/spec/rubocop/cop/lint/assignment_in_condition_spec.rb index 7e66b241459..6a2fac253e4 100644 --- a/spec/rubocop/cop/lint/assignment_in_condition_spec.rb +++ b/spec/rubocop/cop/lint/assignment_in_condition_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::AssignmentInCondition, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowSafeAssignment' => true } } it 'registers an offense for lvar assignment in condition' do diff --git a/spec/rubocop/cop/lint/boolean_symbol_spec.rb b/spec/rubocop/cop/lint/boolean_symbol_spec.rb index b6f15cea43b..6c86061731c 100644 --- a/spec/rubocop/cop/lint/boolean_symbol_spec.rb +++ b/spec/rubocop/cop/lint/boolean_symbol_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::BooleanSymbol, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense when using `:true`' do expect_offense(<<~RUBY) :true diff --git a/spec/rubocop/cop/lint/debugger_spec.rb b/spec/rubocop/cop/lint/debugger_spec.rb index 4aa470f6cda..f052f67837b 100644 --- a/spec/rubocop/cop/lint/debugger_spec.rb +++ b/spec/rubocop/cop/lint/debugger_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::Debugger, :config do - subject(:cop) { described_class.new(config) } - shared_examples_for 'debugger' do |name, src| it "reports an offense for a #{name} call" do inspect_source(src) diff --git a/spec/rubocop/cop/lint/empty_when_spec.rb b/spec/rubocop/cop/lint/empty_when_spec.rb index e65a8c20c6e..c95388d80d3 100644 --- a/spec/rubocop/cop/lint/empty_when_spec.rb +++ b/spec/rubocop/cop/lint/empty_when_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::EmptyWhen, :config do - subject(:cop) { described_class.new(config) } - before do inspect_source(source) end diff --git a/spec/rubocop/cop/lint/erb_new_arguments_spec.rb b/spec/rubocop/cop/lint/erb_new_arguments_spec.rb index 8ff1bd1cc2a..2b237eced42 100644 --- a/spec/rubocop/cop/lint/erb_new_arguments_spec.rb +++ b/spec/rubocop/cop/lint/erb_new_arguments_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::ErbNewArguments, :config do - subject(:cop) { described_class.new(config) } - context '<= Ruby 2.5', :ruby25 do it 'does not register an offense when using `ERB.new` ' \ 'with non-keyword arguments' do diff --git a/spec/rubocop/cop/lint/inherit_exception_spec.rb b/spec/rubocop/cop/lint/inherit_exception_spec.rb index ecb6eabdcd7..2133652e444 100644 --- a/spec/rubocop/cop/lint/inherit_exception_spec.rb +++ b/spec/rubocop/cop/lint/inherit_exception_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::InheritException, :config do - subject(:cop) { described_class.new(config) } - context 'when class inherits from `Exception`' do context 'with enforced style set to `runtime_error`' do let(:cop_config) { { 'EnforcedStyle' => 'runtime_error' } } diff --git a/spec/rubocop/cop/lint/missing_cop_enable_directive_spec.rb b/spec/rubocop/cop/lint/missing_cop_enable_directive_spec.rb index d15adf4002e..1bb7fc5e22c 100644 --- a/spec/rubocop/cop/lint/missing_cop_enable_directive_spec.rb +++ b/spec/rubocop/cop/lint/missing_cop_enable_directive_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::MissingCopEnableDirective, :config do - subject(:cop) { described_class.new(config) } - context 'when the maximum range size is infinite' do let(:cop_config) { { 'MaximumRangeSize' => Float::INFINITY } } diff --git a/spec/rubocop/cop/lint/ordered_magic_comments_spec.rb b/spec/rubocop/cop/lint/ordered_magic_comments_spec.rb index 2125f4692a2..b46a825810d 100644 --- a/spec/rubocop/cop/lint/ordered_magic_comments_spec.rb +++ b/spec/rubocop/cop/lint/ordered_magic_comments_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::OrderedMagicComments, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense and corrects when an `encoding` magic comment ' \ 'does not precede all other magic comments' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/lint/raise_exception_spec.rb b/spec/rubocop/cop/lint/raise_exception_spec.rb index cdc208cfe01..c1172bcab42 100644 --- a/spec/rubocop/cop/lint/raise_exception_spec.rb +++ b/spec/rubocop/cop/lint/raise_exception_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::RaiseException, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowedImplicitNamespaces' => ['Gem'] } } it 'registers an offense for `raise` with `::Exception`' do diff --git a/spec/rubocop/cop/lint/redundant_require_statement_spec.rb b/spec/rubocop/cop/lint/redundant_require_statement_spec.rb index 1a6ac83f298..4629392468a 100644 --- a/spec/rubocop/cop/lint/redundant_require_statement_spec.rb +++ b/spec/rubocop/cop/lint/redundant_require_statement_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::RedundantRequireStatement, :config do - subject(:cop) { described_class.new(config) } - it "registers an offense and corrects when using `require 'enumerator'`" do expect_offense(<<~RUBY) require 'enumerator' diff --git a/spec/rubocop/cop/lint/safe_navigation_chain_spec.rb b/spec/rubocop/cop/lint/safe_navigation_chain_spec.rb index d0359538b27..7c9e1f0d475 100644 --- a/spec/rubocop/cop/lint/safe_navigation_chain_spec.rb +++ b/spec/rubocop/cop/lint/safe_navigation_chain_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::SafeNavigationChain, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'AcceptedMethods' => %w[present? blank? try presence] } end diff --git a/spec/rubocop/cop/lint/safe_navigation_consistency_spec.rb b/spec/rubocop/cop/lint/safe_navigation_consistency_spec.rb index d39d56104cd..67a86577712 100644 --- a/spec/rubocop/cop/lint/safe_navigation_consistency_spec.rb +++ b/spec/rubocop/cop/lint/safe_navigation_consistency_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::SafeNavigationConsistency, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'AllowedMethods' => %w[present? blank? try presence] } end diff --git a/spec/rubocop/cop/lint/shadowed_argument_spec.rb b/spec/rubocop/cop/lint/shadowed_argument_spec.rb index 863dd2586ea..b5df5c067e2 100644 --- a/spec/rubocop/cop/lint/shadowed_argument_spec.rb +++ b/spec/rubocop/cop/lint/shadowed_argument_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::ShadowedArgument, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'IgnoreImplicitReferences' => false } } describe 'method argument shadowing' do diff --git a/spec/rubocop/cop/lint/suppressed_exception_spec.rb b/spec/rubocop/cop/lint/suppressed_exception_spec.rb index e528551526a..4a5bb488a59 100644 --- a/spec/rubocop/cop/lint/suppressed_exception_spec.rb +++ b/spec/rubocop/cop/lint/suppressed_exception_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::SuppressedException, :config do - subject(:cop) { described_class.new(config) } - context 'with AllowComments set to false' do let(:cop_config) { { 'AllowComments' => false } } diff --git a/spec/rubocop/cop/lint/underscore_prefixed_variable_name_spec.rb b/spec/rubocop/cop/lint/underscore_prefixed_variable_name_spec.rb index f6906e33b35..b8da940ef6b 100644 --- a/spec/rubocop/cop/lint/underscore_prefixed_variable_name_spec.rb +++ b/spec/rubocop/cop/lint/underscore_prefixed_variable_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::UnderscorePrefixedVariableName, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowKeywordBlockArguments' => false } } context 'when an underscore-prefixed variable is used' do diff --git a/spec/rubocop/cop/lint/unified_integer_spec.rb b/spec/rubocop/cop/lint/unified_integer_spec.rb index 930dcddb524..d52291f784c 100644 --- a/spec/rubocop/cop/lint/unified_integer_spec.rb +++ b/spec/rubocop/cop/lint/unified_integer_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::UnifiedInteger, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'registers an offense' do |klass| context "when #{klass}" do context 'without any decorations' do diff --git a/spec/rubocop/cop/lint/unused_block_argument_spec.rb b/spec/rubocop/cop/lint/unused_block_argument_spec.rb index 1747f73e67e..ac358974a1f 100644 --- a/spec/rubocop/cop/lint/unused_block_argument_spec.rb +++ b/spec/rubocop/cop/lint/unused_block_argument_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::UnusedBlockArgument, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowUnusedKeywordArguments' => false } } shared_examples 'auto-correction' do |name, old_source, new_source| diff --git a/spec/rubocop/cop/lint/unused_method_argument_spec.rb b/spec/rubocop/cop/lint/unused_method_argument_spec.rb index 0c38209068b..102fb8b7c07 100644 --- a/spec/rubocop/cop/lint/unused_method_argument_spec.rb +++ b/spec/rubocop/cop/lint/unused_method_argument_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Lint::UnusedMethodArgument, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'AllowUnusedKeywordArguments' => false, diff --git a/spec/rubocop/cop/metrics/abc_size_spec.rb b/spec/rubocop/cop/metrics/abc_size_spec.rb index f9a1c3d9e3b..4fa9fa92a9f 100644 --- a/spec/rubocop/cop/metrics/abc_size_spec.rb +++ b/spec/rubocop/cop/metrics/abc_size_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::AbcSize, :config do - subject(:cop) { described_class.new(config) } - context 'when Max is 0' do let(:cop_config) { { 'Max' => 0 } } diff --git a/spec/rubocop/cop/metrics/block_length_spec.rb b/spec/rubocop/cop/metrics/block_length_spec.rb index b445a99e671..76679fac92a 100644 --- a/spec/rubocop/cop/metrics/block_length_spec.rb +++ b/spec/rubocop/cop/metrics/block_length_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::BlockLength, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Max' => 2, 'CountComments' => false } } shared_examples 'ignoring an offense on an excluded method' do |excluded| diff --git a/spec/rubocop/cop/metrics/block_nesting_spec.rb b/spec/rubocop/cop/metrics/block_nesting_spec.rb index 38677b92b98..e3202a4441c 100644 --- a/spec/rubocop/cop/metrics/block_nesting_spec.rb +++ b/spec/rubocop/cop/metrics/block_nesting_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::BlockNesting, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Max' => 2 } } it 'accepts `Max` levels of nesting' do diff --git a/spec/rubocop/cop/metrics/class_length_spec.rb b/spec/rubocop/cop/metrics/class_length_spec.rb index ba95ff6f26b..3a227e2463f 100644 --- a/spec/rubocop/cop/metrics/class_length_spec.rb +++ b/spec/rubocop/cop/metrics/class_length_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::ClassLength, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Max' => 5, 'CountComments' => false } } it 'rejects a class with more than 5 lines' do diff --git a/spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb b/spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb index c176c2422ae..127767d87c4 100644 --- a/spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb +++ b/spec/rubocop/cop/metrics/cyclomatic_complexity_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::CyclomaticComplexity, :config do - subject(:cop) { described_class.new(config) } - context 'when Max is 1' do let(:cop_config) { { 'Max' => 1 } } diff --git a/spec/rubocop/cop/metrics/method_length_spec.rb b/spec/rubocop/cop/metrics/method_length_spec.rb index 5b21b868e81..901472f7528 100644 --- a/spec/rubocop/cop/metrics/method_length_spec.rb +++ b/spec/rubocop/cop/metrics/method_length_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::MethodLength, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Max' => 5, 'CountComments' => false } } context 'when method is an instance method' do diff --git a/spec/rubocop/cop/metrics/module_length_spec.rb b/spec/rubocop/cop/metrics/module_length_spec.rb index 0e13eee8a9e..0150563d1c9 100644 --- a/spec/rubocop/cop/metrics/module_length_spec.rb +++ b/spec/rubocop/cop/metrics/module_length_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::ModuleLength, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Max' => 5, 'CountComments' => false } } it 'rejects a module with more than 5 lines' do diff --git a/spec/rubocop/cop/metrics/parameter_lists_spec.rb b/spec/rubocop/cop/metrics/parameter_lists_spec.rb index 6ca9af6da0d..c2e012eadd3 100644 --- a/spec/rubocop/cop/metrics/parameter_lists_spec.rb +++ b/spec/rubocop/cop/metrics/parameter_lists_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::ParameterLists, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'Max' => 4, diff --git a/spec/rubocop/cop/metrics/perceived_complexity_spec.rb b/spec/rubocop/cop/metrics/perceived_complexity_spec.rb index a457b63895b..8eb470188a5 100644 --- a/spec/rubocop/cop/metrics/perceived_complexity_spec.rb +++ b/spec/rubocop/cop/metrics/perceived_complexity_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Metrics::PerceivedComplexity, :config do - subject(:cop) { described_class.new(config) } - context 'when Max is 1' do let(:cop_config) { { 'Max' => 1 } } diff --git a/spec/rubocop/cop/naming/block_parameter_name_spec.rb b/spec/rubocop/cop/naming/block_parameter_name_spec.rb index c528c4cd462..c2da63c39a3 100644 --- a/spec/rubocop/cop/naming/block_parameter_name_spec.rb +++ b/spec/rubocop/cop/naming/block_parameter_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::BlockParameterName, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'MinNameLength' => 2, diff --git a/spec/rubocop/cop/naming/heredoc_delimiter_case_spec.rb b/spec/rubocop/cop/naming/heredoc_delimiter_case_spec.rb index 03c3bdaeea1..d5c12385e4e 100644 --- a/spec/rubocop/cop/naming/heredoc_delimiter_case_spec.rb +++ b/spec/rubocop/cop/naming/heredoc_delimiter_case_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::HeredocDelimiterCase, :config do - subject(:cop) { described_class.new(config) } - let(:config) do RuboCop::Config.new(described_class.badge.to_s => cop_config) end diff --git a/spec/rubocop/cop/naming/heredoc_delimiter_naming_spec.rb b/spec/rubocop/cop/naming/heredoc_delimiter_naming_spec.rb index 578a971b96c..1a44444c14d 100644 --- a/spec/rubocop/cop/naming/heredoc_delimiter_naming_spec.rb +++ b/spec/rubocop/cop/naming/heredoc_delimiter_naming_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::HeredocDelimiterNaming, :config do - subject(:cop) { described_class.new(config) } - let(:config) do RuboCop::Config.new(described_class.badge.to_s => cop_config) end diff --git a/spec/rubocop/cop/naming/memoized_instance_variable_name_spec.rb b/spec/rubocop/cop/naming/memoized_instance_variable_name_spec.rb index 7dd1509c58d..881086a13eb 100644 --- a/spec/rubocop/cop/naming/memoized_instance_variable_name_spec.rb +++ b/spec/rubocop/cop/naming/memoized_instance_variable_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::MemoizedInstanceVariableName, :config do - subject(:cop) { described_class.new(config) } - context 'with default EnforcedStyleForLeadingUnderscores => disallowed' do let(:cop_config) do { 'EnforcedStyleForLeadingUnderscores' => 'disallowed' } diff --git a/spec/rubocop/cop/naming/method_name_spec.rb b/spec/rubocop/cop/naming/method_name_spec.rb index c950532fb6d..f2659c8b885 100644 --- a/spec/rubocop/cop/naming/method_name_spec.rb +++ b/spec/rubocop/cop/naming/method_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::MethodName, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'never accepted' do |enforced_style| it 'registers an offense for mixed snake case and camel case in attr.' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/naming/method_parameter_name_spec.rb b/spec/rubocop/cop/naming/method_parameter_name_spec.rb index 3ea83f109bd..d675094a9fd 100644 --- a/spec/rubocop/cop/naming/method_parameter_name_spec.rb +++ b/spec/rubocop/cop/naming/method_parameter_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::MethodParameterName, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'MinNameLength' => 3, diff --git a/spec/rubocop/cop/naming/predicate_name_spec.rb b/spec/rubocop/cop/naming/predicate_name_spec.rb index 986d2922ff2..8d8cc78aad7 100644 --- a/spec/rubocop/cop/naming/predicate_name_spec.rb +++ b/spec/rubocop/cop/naming/predicate_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::PredicateName, :config do - subject(:cop) { described_class.new(config) } - context 'with restricted prefixes' do let(:cop_config) do { 'NamePrefix' => %w[has_ is_], diff --git a/spec/rubocop/cop/naming/rescued_exceptions_variable_name_spec.rb b/spec/rubocop/cop/naming/rescued_exceptions_variable_name_spec.rb index 91fc0d75c34..bc9ba0d1724 100644 --- a/spec/rubocop/cop/naming/rescued_exceptions_variable_name_spec.rb +++ b/spec/rubocop/cop/naming/rescued_exceptions_variable_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::RescuedExceptionsVariableName, :config do - subject(:cop) { described_class.new(config) } - context 'with default config' do context 'with explicit rescue' do context 'with `Exception` variable' do diff --git a/spec/rubocop/cop/naming/variable_name_spec.rb b/spec/rubocop/cop/naming/variable_name_spec.rb index 69d8fc8fbfa..f7f4798fed8 100644 --- a/spec/rubocop/cop/naming/variable_name_spec.rb +++ b/spec/rubocop/cop/naming/variable_name_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::VariableName, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'always accepted' do it 'accepts screaming snake case globals' do expect_no_offenses('$MY_GLOBAL = 0') diff --git a/spec/rubocop/cop/naming/variable_number_spec.rb b/spec/rubocop/cop/naming/variable_number_spec.rb index 25a43b47803..b5c4e574f8b 100644 --- a/spec/rubocop/cop/naming/variable_number_spec.rb +++ b/spec/rubocop/cop/naming/variable_number_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Naming::VariableNumber, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'offense' do |style, variable, style_to_allow_offenses| it "registers an offense for #{Array(variable).first} in #{style}" do inspect_source(Array(variable).map { |v| "#{v} = 1" }.join("\n")) diff --git a/spec/rubocop/cop/security/json_load_spec.rb b/spec/rubocop/cop/security/json_load_spec.rb index 2a8da215850..fe742492d47 100644 --- a/spec/rubocop/cop/security/json_load_spec.rb +++ b/spec/rubocop/cop/security/json_load_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Security::JSONLoad, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense and corrects JSON.load' do expect_offense(<<~RUBY) JSON.load(arg) diff --git a/spec/rubocop/cop/security/marshal_load_spec.rb b/spec/rubocop/cop/security/marshal_load_spec.rb index 232527edb15..c84a8d332ca 100644 --- a/spec/rubocop/cop/security/marshal_load_spec.rb +++ b/spec/rubocop/cop/security/marshal_load_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Security::MarshalLoad, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense for using Marshal.load' do expect_offense(<<~RUBY) Marshal.load('{}') diff --git a/spec/rubocop/cop/security/yaml_load_spec.rb b/spec/rubocop/cop/security/yaml_load_spec.rb index 8f46c91a657..1c3e358d8c9 100644 --- a/spec/rubocop/cop/security/yaml_load_spec.rb +++ b/spec/rubocop/cop/security/yaml_load_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Security::YAMLLoad, :config do - subject(:cop) { described_class.new(config) } - it 'does not register an offense for YAML.dump' do expect_no_offenses(<<~RUBY) YAML.dump("foo") diff --git a/spec/rubocop/cop/style/access_modifier_declarations_spec.rb b/spec/rubocop/cop/style/access_modifier_declarations_spec.rb index f874536b89f..b87af5ca5dc 100644 --- a/spec/rubocop/cop/style/access_modifier_declarations_spec.rb +++ b/spec/rubocop/cop/style/access_modifier_declarations_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::AccessModifierDeclarations, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'always accepted' do |access_modifier| it 'accepts when #{access_modifier} is a hash literal value' do expect_no_offenses(<<~RUBY) diff --git a/spec/rubocop/cop/style/alias_spec.rb b/spec/rubocop/cop/style/alias_spec.rb index 0d55eef8308..9a5e5cef407 100644 --- a/spec/rubocop/cop/style/alias_spec.rb +++ b/spec/rubocop/cop/style/alias_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Alias, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is prefer_alias_method' do let(:cop_config) { { 'EnforcedStyle' => 'prefer_alias_method' } } diff --git a/spec/rubocop/cop/style/ascii_comments_spec.rb b/spec/rubocop/cop/style/ascii_comments_spec.rb index 6d35689afe0..4b40990951b 100644 --- a/spec/rubocop/cop/style/ascii_comments_spec.rb +++ b/spec/rubocop/cop/style/ascii_comments_spec.rb @@ -22,8 +22,6 @@ end context 'when certain non-ascii chars are allowed', :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowedChars' => ['∂'] } } it 'accepts comment with allowed non-ascii chars' do diff --git a/spec/rubocop/cop/style/bare_percent_literals_spec.rb b/spec/rubocop/cop/style/bare_percent_literals_spec.rb index 57038a2170c..6faac031c05 100644 --- a/spec/rubocop/cop/style/bare_percent_literals_spec.rb +++ b/spec/rubocop/cop/style/bare_percent_literals_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::BarePercentLiterals, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'accepts other delimiters' do it 'accepts __FILE__' do expect_no_offenses('__FILE__') diff --git a/spec/rubocop/cop/style/block_delimiters_spec.rb b/spec/rubocop/cop/style/block_delimiters_spec.rb index 4e286316025..ece24e90d6c 100644 --- a/spec/rubocop/cop/style/block_delimiters_spec.rb +++ b/spec/rubocop/cop/style/block_delimiters_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::BlockDelimiters, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'syntactic styles' do it 'registers an offense for a single line block with do-end' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/style/class_and_module_children_spec.rb b/spec/rubocop/cop/style/class_and_module_children_spec.rb index ef3c87a2826..b11a6e6b3c8 100644 --- a/spec/rubocop/cop/style/class_and_module_children_spec.rb +++ b/spec/rubocop/cop/style/class_and_module_children_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ClassAndModuleChildren, :config do - subject(:cop) { described_class.new(config) } - context 'nested style' do let(:cop_config) { { 'EnforcedStyle' => 'nested' } } diff --git a/spec/rubocop/cop/style/class_check_spec.rb b/spec/rubocop/cop/style/class_check_spec.rb index 4c57b905428..79ce6810e60 100644 --- a/spec/rubocop/cop/style/class_check_spec.rb +++ b/spec/rubocop/cop/style/class_check_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ClassCheck, :config do - subject(:cop) { described_class.new(config) } - context 'when enforced style is is_a?' do let(:cop_config) { { 'EnforcedStyle' => 'is_a?' } } diff --git a/spec/rubocop/cop/style/command_literal_spec.rb b/spec/rubocop/cop/style/command_literal_spec.rb index c16425f4100..410e7c442e3 100644 --- a/spec/rubocop/cop/style/command_literal_spec.rb +++ b/spec/rubocop/cop/style/command_literal_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::CommandLiteral, :config do - subject(:cop) { described_class.new(config) } - let(:config) do supported_styles = { 'SupportedStyles' => %w[backticks percent_x mixed] diff --git a/spec/rubocop/cop/style/comment_annotation_spec.rb b/spec/rubocop/cop/style/comment_annotation_spec.rb index ee8dc063adf..52ef21f3502 100644 --- a/spec/rubocop/cop/style/comment_annotation_spec.rb +++ b/spec/rubocop/cop/style/comment_annotation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::CommentAnnotation, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'Keywords' => %w[TODO FIXME OPTIMIZE HACK REVIEW] } end diff --git a/spec/rubocop/cop/style/copyright_spec.rb b/spec/rubocop/cop/style/copyright_spec.rb index 6cdbfcde172..aa90620121e 100644 --- a/spec/rubocop/cop/style/copyright_spec.rb +++ b/spec/rubocop/cop/style/copyright_spec.rb @@ -6,8 +6,6 @@ def expect_copyright_offense(cop, source) end RSpec.describe RuboCop::Cop::Style::Copyright, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'Notice' => 'Copyright (\(c\) )?2015 Acme Inc' } } it 'does not register an offense when the notice is present' do diff --git a/spec/rubocop/cop/style/date_time_spec.rb b/spec/rubocop/cop/style/date_time_spec.rb index 616ce9c8021..74bf41e2796 100644 --- a/spec/rubocop/cop/style/date_time_spec.rb +++ b/spec/rubocop/cop/style/date_time_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::DateTime, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowCoercion' => false } } it 'registers an offense when using DateTime for current time' do diff --git a/spec/rubocop/cop/style/dir_spec.rb b/spec/rubocop/cop/style/dir_spec.rb index 4d3fc392186..9919072903a 100644 --- a/spec/rubocop/cop/style/dir_spec.rb +++ b/spec/rubocop/cop/style/dir_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Dir, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'auto-correct' do |original, expected| it 'auto-corrects' do new_source = autocorrect_source(original) diff --git a/spec/rubocop/cop/style/documentation_method_spec.rb b/spec/rubocop/cop/style/documentation_method_spec.rb index a96d6835747..74223bf18fc 100644 --- a/spec/rubocop/cop/style/documentation_method_spec.rb +++ b/spec/rubocop/cop/style/documentation_method_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::DocumentationMethod, :config do - subject(:cop) { described_class.new(config) } - let(:require_for_non_public_methods) { false } let(:config) do diff --git a/spec/rubocop/cop/style/empty_method_spec.rb b/spec/rubocop/cop/style/empty_method_spec.rb index 957f6abe8ba..3d350c7abbc 100644 --- a/spec/rubocop/cop/style/empty_method_spec.rb +++ b/spec/rubocop/cop/style/empty_method_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::EmptyMethod, :config do - subject(:cop) { described_class.new(config) } - before do inspect_source(source) end diff --git a/spec/rubocop/cop/style/encoding_spec.rb b/spec/rubocop/cop/style/encoding_spec.rb index 0ca132215cf..51bd9c53ddc 100644 --- a/spec/rubocop/cop/style/encoding_spec.rb +++ b/spec/rubocop/cop/style/encoding_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Encoding, :config do - subject(:cop) { described_class.new(config) } - it 'registers no offense when no encoding present' do expect_no_offenses(<<~RUBY) def foo() end diff --git a/spec/rubocop/cop/style/expand_path_arguments_spec.rb b/spec/rubocop/cop/style/expand_path_arguments_spec.rb index 92854d3c225..841086ec59a 100644 --- a/spec/rubocop/cop/style/expand_path_arguments_spec.rb +++ b/spec/rubocop/cop/style/expand_path_arguments_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ExpandPathArguments, :config do - subject(:cop) { described_class.new(config) } - it "registers an offense when using `File.expand_path('..', __FILE__)`" do expect_offense(<<~RUBY) File.expand_path('..', __FILE__) diff --git a/spec/rubocop/cop/style/exponential_notation_spec.rb b/spec/rubocop/cop/style/exponential_notation_spec.rb index e29098371e2..3787f87a551 100644 --- a/spec/rubocop/cop/style/exponential_notation_spec.rb +++ b/spec/rubocop/cop/style/exponential_notation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ExponentialNotation, :config do - subject(:cop) { described_class.new(config) } - context 'EnforcedStyle is scientific' do let(:cop_config) { { 'EnforcedStyle' => 'scientific' } } diff --git a/spec/rubocop/cop/style/float_division_spec.rb b/spec/rubocop/cop/style/float_division_spec.rb index 47ee724ee4c..1e9e95061ee 100644 --- a/spec/rubocop/cop/style/float_division_spec.rb +++ b/spec/rubocop/cop/style/float_division_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::FloatDivision, :config do - subject(:cop) { described_class.new(config) } - context 'EnforcedStyle is left_coerce' do let(:cop_config) { { 'EnforcedStyle' => 'left_coerce' } } diff --git a/spec/rubocop/cop/style/for_spec.rb b/spec/rubocop/cop/style/for_spec.rb index f40bf7c208b..90064fa12c4 100644 --- a/spec/rubocop/cop/style/for_spec.rb +++ b/spec/rubocop/cop/style/for_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::For, :config do - subject(:cop) { described_class.new(config) } - context 'when each is the enforced style' do let(:cop_config) { { 'EnforcedStyle' => 'each' } } diff --git a/spec/rubocop/cop/style/format_string_spec.rb b/spec/rubocop/cop/style/format_string_spec.rb index 613bf8a4fdd..c12e21a461b 100644 --- a/spec/rubocop/cop/style/format_string_spec.rb +++ b/spec/rubocop/cop/style/format_string_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::FormatString, :config do - subject(:cop) { described_class.new(config) } - context 'when enforced style is sprintf' do let(:cop_config) { { 'EnforcedStyle' => 'sprintf' } } diff --git a/spec/rubocop/cop/style/format_string_token_spec.rb b/spec/rubocop/cop/style/format_string_token_spec.rb index 56bdb0ee8c3..20e51ad710d 100644 --- a/spec/rubocop/cop/style/format_string_token_spec.rb +++ b/spec/rubocop/cop/style/format_string_token_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::FormatStringToken, :config do - subject(:cop) { described_class.new(config) } - let(:enforced_style) { :annotated } let(:cop_config) do diff --git a/spec/rubocop/cop/style/frozen_string_literal_comment_spec.rb b/spec/rubocop/cop/style/frozen_string_literal_comment_spec.rb index 5323a414027..1cc817c0e76 100644 --- a/spec/rubocop/cop/style/frozen_string_literal_comment_spec.rb +++ b/spec/rubocop/cop/style/frozen_string_literal_comment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::FrozenStringLiteralComment, :config do - subject(:cop) { described_class.new(config) } - context 'always' do let(:cop_config) do { 'Enabled' => true, diff --git a/spec/rubocop/cop/style/hash_syntax_spec.rb b/spec/rubocop/cop/style/hash_syntax_spec.rb index 56d781da2fa..c06800ce0f6 100644 --- a/spec/rubocop/cop/style/hash_syntax_spec.rb +++ b/spec/rubocop/cop/style/hash_syntax_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::HashSyntax, :config do - subject(:cop) { described_class.new(config) } - context 'configured to enforce ruby19 style' do context 'with SpaceAroundOperators enabled' do let(:config) do diff --git a/spec/rubocop/cop/style/hash_transform_keys_spec.rb b/spec/rubocop/cop/style/hash_transform_keys_spec.rb index a702eff24d8..5df5875c22c 100644 --- a/spec/rubocop/cop/style/hash_transform_keys_spec.rb +++ b/spec/rubocop/cop/style/hash_transform_keys_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::HashTransformKeys, :config do - subject(:cop) { described_class.new(config) } - context 'when using Ruby 2.5 or newer', :ruby25 do context 'with inline block' do it 'flags each_with_object when transform_keys could be used' do diff --git a/spec/rubocop/cop/style/hash_transform_values_spec.rb b/spec/rubocop/cop/style/hash_transform_values_spec.rb index 266ac53c4e4..24a4e46c8c2 100644 --- a/spec/rubocop/cop/style/hash_transform_values_spec.rb +++ b/spec/rubocop/cop/style/hash_transform_values_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::HashTransformValues, :config do - subject(:cop) { described_class.new(config) } - context 'with inline block' do it 'flags each_with_object when transform_values could be used' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/style/if_inside_else_spec.rb b/spec/rubocop/cop/style/if_inside_else_spec.rb index 21c0c36660e..abb0f0fa2fc 100644 --- a/spec/rubocop/cop/style/if_inside_else_spec.rb +++ b/spec/rubocop/cop/style/if_inside_else_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::IfInsideElse, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'AllowIfModifier' => false } end diff --git a/spec/rubocop/cop/style/ip_addresses_spec.rb b/spec/rubocop/cop/style/ip_addresses_spec.rb index ca7f6f71ac3..0f65503d88a 100644 --- a/spec/rubocop/cop/style/ip_addresses_spec.rb +++ b/spec/rubocop/cop/style/ip_addresses_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::IpAddresses, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { {} } it 'does not register an offense on an empty string' do diff --git a/spec/rubocop/cop/style/lambda_call_spec.rb b/spec/rubocop/cop/style/lambda_call_spec.rb index da5ca4222d9..55b174d87f2 100644 --- a/spec/rubocop/cop/style/lambda_call_spec.rb +++ b/spec/rubocop/cop/style/lambda_call_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::LambdaCall, :config do - subject(:cop) { described_class.new(config) } - context 'when style is set to call' do let(:cop_config) { { 'EnforcedStyle' => 'call' } } diff --git a/spec/rubocop/cop/style/lambda_spec.rb b/spec/rubocop/cop/style/lambda_spec.rb index a734511d76e..ade4aa7ac0f 100644 --- a/spec/rubocop/cop/style/lambda_spec.rb +++ b/spec/rubocop/cop/style/lambda_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Lambda, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'registers an offense' do |message| it 'registers an offense' do inspect_source(source) diff --git a/spec/rubocop/cop/style/method_call_with_args_parentheses_spec.rb b/spec/rubocop/cop/style/method_call_with_args_parentheses_spec.rb index a02234a4197..117dbc5abda 100644 --- a/spec/rubocop/cop/style/method_call_with_args_parentheses_spec.rb +++ b/spec/rubocop/cop/style/method_call_with_args_parentheses_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MethodCallWithArgsParentheses, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is require_parentheses (default)' do let(:cop_config) do { 'IgnoredMethods' => %w[puts] } diff --git a/spec/rubocop/cop/style/method_call_without_args_parentheses_spec.rb b/spec/rubocop/cop/style/method_call_without_args_parentheses_spec.rb index 2426f9854d0..f22258af931 100644 --- a/spec/rubocop/cop/style/method_call_without_args_parentheses_spec.rb +++ b/spec/rubocop/cop/style/method_call_without_args_parentheses_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MethodCallWithoutArgsParentheses, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'IgnoredMethods' => %w[s] } end diff --git a/spec/rubocop/cop/style/method_def_parentheses_spec.rb b/spec/rubocop/cop/style/method_def_parentheses_spec.rb index 7cfff0731a7..e98821540f3 100644 --- a/spec/rubocop/cop/style/method_def_parentheses_spec.rb +++ b/spec/rubocop/cop/style/method_def_parentheses_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MethodDefParentheses, :config do - subject(:cop) { described_class.new(config) } - context 'require_parentheses' do let(:cop_config) { { 'EnforcedStyle' => 'require_parentheses' } } diff --git a/spec/rubocop/cop/style/min_max_spec.rb b/spec/rubocop/cop/style/min_max_spec.rb index e00899b5d8d..75cb98ed7d4 100644 --- a/spec/rubocop/cop/style/min_max_spec.rb +++ b/spec/rubocop/cop/style/min_max_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MinMax, :config do - subject(:cop) { described_class.new(config) } - context 'with an array literal containing calls to `#min` and `#max`' do context 'when the expression stands alone' do it 'registers an offense if the receivers match' do diff --git a/spec/rubocop/cop/style/mixin_grouping_spec.rb b/spec/rubocop/cop/style/mixin_grouping_spec.rb index f300a8d20b9..d7d8ebd65ae 100644 --- a/spec/rubocop/cop/style/mixin_grouping_spec.rb +++ b/spec/rubocop/cop/style/mixin_grouping_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MixinGrouping, :config do - subject(:cop) { described_class.new(config) } - before do inspect_source(source) end diff --git a/spec/rubocop/cop/style/module_function_spec.rb b/spec/rubocop/cop/style/module_function_spec.rb index 5409f4606de..d4a08db10d9 100644 --- a/spec/rubocop/cop/style/module_function_spec.rb +++ b/spec/rubocop/cop/style/module_function_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ModuleFunction, :config do - subject(:cop) { described_class.new(config) } - context 'when enforced style is `module_function`' do let(:cop_config) { { 'EnforcedStyle' => 'module_function' } } diff --git a/spec/rubocop/cop/style/multiline_memoization_spec.rb b/spec/rubocop/cop/style/multiline_memoization_spec.rb index 92d75bfe0c6..6abe4f795b0 100644 --- a/spec/rubocop/cop/style/multiline_memoization_spec.rb +++ b/spec/rubocop/cop/style/multiline_memoization_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MultilineMemoization, :config do - subject(:cop) { described_class.new(config) } - let(:message) { 'Wrap multiline memoization blocks in `begin` and `end`.' } before do diff --git a/spec/rubocop/cop/style/multiline_method_signature_spec.rb b/spec/rubocop/cop/style/multiline_method_signature_spec.rb index d36262789da..0d9ff260d08 100644 --- a/spec/rubocop/cop/style/multiline_method_signature_spec.rb +++ b/spec/rubocop/cop/style/multiline_method_signature_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MultilineMethodSignature, :config do - subject(:cop) { described_class.new(config) } - context 'when arguments span multiple lines' do context 'when defining an instance method' do it 'registers an offense when `end` is on the following line' do diff --git a/spec/rubocop/cop/style/mutable_constant_spec.rb b/spec/rubocop/cop/style/mutable_constant_spec.rb index 79fd195c1b8..ca503ffae45 100644 --- a/spec/rubocop/cop/style/mutable_constant_spec.rb +++ b/spec/rubocop/cop/style/mutable_constant_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::MutableConstant, :config do - subject(:cop) { described_class.new(config) } - let(:prefix) { nil } shared_examples 'mutable objects' do |o| diff --git a/spec/rubocop/cop/style/next_spec.rb b/spec/rubocop/cop/style/next_spec.rb index 93859efc4d3..da3d54407e8 100644 --- a/spec/rubocop/cop/style/next_spec.rb +++ b/spec/rubocop/cop/style/next_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Next, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'MinBodyLength' => 1 } } shared_examples 'iterators' do |condition| diff --git a/spec/rubocop/cop/style/nil_comparison_spec.rb b/spec/rubocop/cop/style/nil_comparison_spec.rb index 283939f36f5..e7d2ded9005 100644 --- a/spec/rubocop/cop/style/nil_comparison_spec.rb +++ b/spec/rubocop/cop/style/nil_comparison_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::NilComparison, :config do - subject(:cop) { described_class.new(config) } - context 'configured with predicate preferred' do let(:cop_config) { { 'EnforcedStyle' => 'predicate' } } diff --git a/spec/rubocop/cop/style/non_nil_check_spec.rb b/spec/rubocop/cop/style/non_nil_check_spec.rb index 2c273f2722b..b5f4b6e7176 100644 --- a/spec/rubocop/cop/style/non_nil_check_spec.rb +++ b/spec/rubocop/cop/style/non_nil_check_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::NonNilCheck, :config do - subject(:cop) { described_class.new(config) } - context 'when not allowing semantic changes' do let(:cop_config) do { diff --git a/spec/rubocop/cop/style/not_spec.rb b/spec/rubocop/cop/style/not_spec.rb index adda6b7a921..bf6ad28c1a1 100644 --- a/spec/rubocop/cop/style/not_spec.rb +++ b/spec/rubocop/cop/style/not_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Not, :config do - subject(:cop) { described_class.new(config) } - it 'registers an offense for not' do expect_offense(<<~RUBY) not test diff --git a/spec/rubocop/cop/style/numeric_literal_prefix_spec.rb b/spec/rubocop/cop/style/numeric_literal_prefix_spec.rb index 61c25fbded5..4138e2014d1 100644 --- a/spec/rubocop/cop/style/numeric_literal_prefix_spec.rb +++ b/spec/rubocop/cop/style/numeric_literal_prefix_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::NumericLiteralPrefix, :config do - subject(:cop) { described_class.new(config) } - context 'octal literals' do context 'when config is zero_with_o' do let(:cop_config) do diff --git a/spec/rubocop/cop/style/numeric_literals_spec.rb b/spec/rubocop/cop/style/numeric_literals_spec.rb index 17faa9d75b6..b1bee7e236c 100644 --- a/spec/rubocop/cop/style/numeric_literals_spec.rb +++ b/spec/rubocop/cop/style/numeric_literals_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::NumericLiterals, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'MinDigits' => 5 } } it 'registers an offense for a long undelimited integer' do diff --git a/spec/rubocop/cop/style/numeric_predicate_spec.rb b/spec/rubocop/cop/style/numeric_predicate_spec.rb index 53d37a9d7ac..0943d945129 100644 --- a/spec/rubocop/cop/style/numeric_predicate_spec.rb +++ b/spec/rubocop/cop/style/numeric_predicate_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::NumericPredicate, :config do - subject(:cop) { described_class.new(config) } - before do inspect_source(source) end diff --git a/spec/rubocop/cop/style/option_hash_spec.rb b/spec/rubocop/cop/style/option_hash_spec.rb index e4546b37ddc..e63e5a7c30b 100644 --- a/spec/rubocop/cop/style/option_hash_spec.rb +++ b/spec/rubocop/cop/style/option_hash_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::OptionHash, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'SuspiciousParamNames' => suspicious_names } } let(:suspicious_names) { ['options'] } diff --git a/spec/rubocop/cop/style/parallel_assignment_spec.rb b/spec/rubocop/cop/style/parallel_assignment_spec.rb index 26ac08e7a64..c802f9728ab 100644 --- a/spec/rubocop/cop/style/parallel_assignment_spec.rb +++ b/spec/rubocop/cop/style/parallel_assignment_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ParallelAssignment, :config do - subject(:cop) { described_class.new(config) } - let(:config) do RuboCop::Config.new('Layout/IndentationWidth' => { 'Width' => 2 }) end diff --git a/spec/rubocop/cop/style/parentheses_around_condition_spec.rb b/spec/rubocop/cop/style/parentheses_around_condition_spec.rb index 953e1dc2bfb..a708b16ffc7 100644 --- a/spec/rubocop/cop/style/parentheses_around_condition_spec.rb +++ b/spec/rubocop/cop/style/parentheses_around_condition_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::ParenthesesAroundCondition, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowSafeAssignment' => true } } it 'registers an offense for parentheses around condition' do diff --git a/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb b/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb index 852da34b970..82a63159cd3 100644 --- a/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb +++ b/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::PercentLiteralDelimiters, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'PreferredDelimiters' => { 'default' => '[]' } } end diff --git a/spec/rubocop/cop/style/percent_q_literals_spec.rb b/spec/rubocop/cop/style/percent_q_literals_spec.rb index 1d26cc3d974..2f77af9f684 100644 --- a/spec/rubocop/cop/style/percent_q_literals_spec.rb +++ b/spec/rubocop/cop/style/percent_q_literals_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::PercentQLiterals, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'accepts quote characters' do it 'accepts single quotes' do expect_no_offenses("'hi'") diff --git a/spec/rubocop/cop/style/preferred_hash_methods_spec.rb b/spec/rubocop/cop/style/preferred_hash_methods_spec.rb index 7c33c848e1e..57e45da598c 100644 --- a/spec/rubocop/cop/style/preferred_hash_methods_spec.rb +++ b/spec/rubocop/cop/style/preferred_hash_methods_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::PreferredHashMethods, :config do - subject(:cop) { described_class.new(config) } - context 'with enforced `short` style' do let(:cop_config) { { 'EnforcedStyle' => 'short' } } diff --git a/spec/rubocop/cop/style/raise_args_spec.rb b/spec/rubocop/cop/style/raise_args_spec.rb index 6fc5c0a4f1c..36094538a22 100644 --- a/spec/rubocop/cop/style/raise_args_spec.rb +++ b/spec/rubocop/cop/style/raise_args_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::RaiseArgs, :config do - subject(:cop) { described_class.new(config) } - context 'when enforced style is compact' do let(:cop_config) { { 'EnforcedStyle' => 'compact' } } diff --git a/spec/rubocop/cop/style/redundant_begin_spec.rb b/spec/rubocop/cop/style/redundant_begin_spec.rb index 14f691e28d7..e8eda434982 100644 --- a/spec/rubocop/cop/style/redundant_begin_spec.rb +++ b/spec/rubocop/cop/style/redundant_begin_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::RedundantBegin, :config do - subject(:cop) { described_class.new(config) } - it 'reports an offense for single line def with redundant begin block' do expect_offense(<<~RUBY) def func; begin; x; y; rescue; z end; end diff --git a/spec/rubocop/cop/style/redundant_return_spec.rb b/spec/rubocop/cop/style/redundant_return_spec.rb index d3c06bd017c..eb0d74ebedf 100644 --- a/spec/rubocop/cop/style/redundant_return_spec.rb +++ b/spec/rubocop/cop/style/redundant_return_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::RedundantReturn, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowMultipleReturnValues' => false } } it 'reports an offense for def with only a return' do diff --git a/spec/rubocop/cop/style/regexp_literal_spec.rb b/spec/rubocop/cop/style/regexp_literal_spec.rb index 5a4bdf51244..58382576f0d 100644 --- a/spec/rubocop/cop/style/regexp_literal_spec.rb +++ b/spec/rubocop/cop/style/regexp_literal_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::RegexpLiteral, :config do - subject(:cop) { described_class.new(config) } - let(:config) do supported_styles = { 'SupportedStyles' => %w[slashes percent_r mixed] diff --git a/spec/rubocop/cop/style/rescue_standard_error_spec.rb b/spec/rubocop/cop/style/rescue_standard_error_spec.rb index 763aae2f392..e7d345497cd 100644 --- a/spec/rubocop/cop/style/rescue_standard_error_spec.rb +++ b/spec/rubocop/cop/style/rescue_standard_error_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::RescueStandardError, :config do - subject(:cop) { described_class.new(config) } - context 'implicit' do let(:cop_config) do { 'EnforcedStyle' => 'implicit', diff --git a/spec/rubocop/cop/style/safe_navigation_spec.rb b/spec/rubocop/cop/style/safe_navigation_spec.rb index c7139b56d7a..b2aa7470d1c 100644 --- a/spec/rubocop/cop/style/safe_navigation_spec.rb +++ b/spec/rubocop/cop/style/safe_navigation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SafeNavigation, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'ConvertCodeThatCanStartToReturnNil' => false } } let(:message) do diff --git a/spec/rubocop/cop/style/semicolon_spec.rb b/spec/rubocop/cop/style/semicolon_spec.rb index f05e9562507..1716a2fdac1 100644 --- a/spec/rubocop/cop/style/semicolon_spec.rb +++ b/spec/rubocop/cop/style/semicolon_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::Semicolon, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowAsExpressionSeparator' => false } } it 'registers an offense for a single expression' do diff --git a/spec/rubocop/cop/style/signal_exception_spec.rb b/spec/rubocop/cop/style/signal_exception_spec.rb index d0408107276..a13e8a4ad1e 100644 --- a/spec/rubocop/cop/style/signal_exception_spec.rb +++ b/spec/rubocop/cop/style/signal_exception_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SignalException, :config do - subject(:cop) { described_class.new(config) } - context 'when enforced style is `semantic`' do let(:cop_config) { { 'EnforcedStyle' => 'semantic' } } diff --git a/spec/rubocop/cop/style/single_line_block_params_spec.rb b/spec/rubocop/cop/style/single_line_block_params_spec.rb index 0caf51fcdd9..27c01f8adc0 100644 --- a/spec/rubocop/cop/style/single_line_block_params_spec.rb +++ b/spec/rubocop/cop/style/single_line_block_params_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SingleLineBlockParams, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'Methods' => [{ 'reduce' => %w[a e] }, diff --git a/spec/rubocop/cop/style/slicing_with_range_spec.rb b/spec/rubocop/cop/style/slicing_with_range_spec.rb index 7395626a75b..2250eea4273 100644 --- a/spec/rubocop/cop/style/slicing_with_range_spec.rb +++ b/spec/rubocop/cop/style/slicing_with_range_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SlicingWithRange, :config do - subject(:cop) { described_class.new(config) } - context '<= Ruby 2.5', :ruby25 do it 'reports no offense for array slicing with -1' do expect_no_offenses(<<~RUBY) diff --git a/spec/rubocop/cop/style/special_global_vars_spec.rb b/spec/rubocop/cop/style/special_global_vars_spec.rb index 71d18a058b9..514770bda86 100644 --- a/spec/rubocop/cop/style/special_global_vars_spec.rb +++ b/spec/rubocop/cop/style/special_global_vars_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SpecialGlobalVars, :config do - subject(:cop) { described_class.new(config) } - context 'when style is use_english_names' do let(:cop_config) { { 'EnforcedStyle' => 'use_english_names' } } diff --git a/spec/rubocop/cop/style/stabby_lambda_parentheses_spec.rb b/spec/rubocop/cop/style/stabby_lambda_parentheses_spec.rb index 38a43aa6735..f3c743fd89a 100644 --- a/spec/rubocop/cop/style/stabby_lambda_parentheses_spec.rb +++ b/spec/rubocop/cop/style/stabby_lambda_parentheses_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::StabbyLambdaParentheses, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'common' do it 'does not check the old lambda syntax' do expect_no_offenses('lambda(&:nil?)') diff --git a/spec/rubocop/cop/style/string_literals_in_interpolation_spec.rb b/spec/rubocop/cop/style/string_literals_in_interpolation_spec.rb index 49b1ac56921..beb92923c64 100644 --- a/spec/rubocop/cop/style/string_literals_in_interpolation_spec.rb +++ b/spec/rubocop/cop/style/string_literals_in_interpolation_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::StringLiteralsInInterpolation, :config do - subject(:cop) { described_class.new(config) } - context 'configured with single quotes preferred' do let(:cop_config) { { 'EnforcedStyle' => 'single_quotes' } } diff --git a/spec/rubocop/cop/style/string_literals_spec.rb b/spec/rubocop/cop/style/string_literals_spec.rb index 7e7e537f4ac..2cde4e12833 100644 --- a/spec/rubocop/cop/style/string_literals_spec.rb +++ b/spec/rubocop/cop/style/string_literals_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::StringLiterals, :config do - subject(:cop) { described_class.new(config) } - context 'configured with single quotes preferred' do let(:cop_config) { { 'EnforcedStyle' => 'single_quotes' } } diff --git a/spec/rubocop/cop/style/string_methods_spec.rb b/spec/rubocop/cop/style/string_methods_spec.rb index 5eab9d5194c..49defd73020 100644 --- a/spec/rubocop/cop/style/string_methods_spec.rb +++ b/spec/rubocop/cop/style/string_methods_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::StringMethods, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'intern' => 'to_sym' } } it 'registers an offense' do diff --git a/spec/rubocop/cop/style/symbol_array_spec.rb b/spec/rubocop/cop/style/symbol_array_spec.rb index 71b92edeb3a..824ab84ce83 100644 --- a/spec/rubocop/cop/style/symbol_array_spec.rb +++ b/spec/rubocop/cop/style/symbol_array_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SymbolArray, :config do - subject(:cop) { described_class.new(config) } - before do # Reset data which is shared by all instances of SymbolArray described_class.largest_brackets = -Float::INFINITY diff --git a/spec/rubocop/cop/style/symbol_proc_spec.rb b/spec/rubocop/cop/style/symbol_proc_spec.rb index fce2850b8b6..0a6e6325c19 100644 --- a/spec/rubocop/cop/style/symbol_proc_spec.rb +++ b/spec/rubocop/cop/style/symbol_proc_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::SymbolProc, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'IgnoredMethods' => %w[respond_to] } } it 'registers an offense for a block with parameterless method call on ' \ diff --git a/spec/rubocop/cop/style/ternary_parentheses_spec.rb b/spec/rubocop/cop/style/ternary_parentheses_spec.rb index bd911b6bdae..ff3ceb7c7f4 100644 --- a/spec/rubocop/cop/style/ternary_parentheses_spec.rb +++ b/spec/rubocop/cop/style/ternary_parentheses_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::TernaryParentheses, :config do - subject(:cop) { described_class.new(config) } - before do inspect_source(source) end diff --git a/spec/rubocop/cop/style/trailing_comma_in_arguments_spec.rb b/spec/rubocop/cop/style/trailing_comma_in_arguments_spec.rb index 38db0aa7bac..86206e73080 100644 --- a/spec/rubocop/cop/style/trailing_comma_in_arguments_spec.rb +++ b/spec/rubocop/cop/style/trailing_comma_in_arguments_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::TrailingCommaInArguments, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'single line lists' do |extra_info| it 'registers an offense for trailing comma in a method call' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/style/trailing_comma_in_array_literal_spec.rb b/spec/rubocop/cop/style/trailing_comma_in_array_literal_spec.rb index 255c7344135..3fd6e496076 100644 --- a/spec/rubocop/cop/style/trailing_comma_in_array_literal_spec.rb +++ b/spec/rubocop/cop/style/trailing_comma_in_array_literal_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::TrailingCommaInArrayLiteral, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'single line lists' do |extra_info| it 'registers an offense for trailing comma' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/style/trailing_comma_in_hash_literal_spec.rb b/spec/rubocop/cop/style/trailing_comma_in_hash_literal_spec.rb index ed363271d65..86f74d73a68 100644 --- a/spec/rubocop/cop/style/trailing_comma_in_hash_literal_spec.rb +++ b/spec/rubocop/cop/style/trailing_comma_in_hash_literal_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::TrailingCommaInHashLiteral, :config do - subject(:cop) { described_class.new(config) } - shared_examples 'single line lists' do |extra_info| it 'registers an offense for trailing comma in a literal' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/style/trivial_accessors_spec.rb b/spec/rubocop/cop/style/trivial_accessors_spec.rb index cb74224d759..6703fe6d97d 100644 --- a/spec/rubocop/cop/style/trivial_accessors_spec.rb +++ b/spec/rubocop/cop/style/trivial_accessors_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::TrivialAccessors, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) { {} } it 'registers an offense on instance reader' do diff --git a/spec/rubocop/cop/style/unpack_first_spec.rb b/spec/rubocop/cop/style/unpack_first_spec.rb index 61fefa05bc7..c39582ed17f 100644 --- a/spec/rubocop/cop/style/unpack_first_spec.rb +++ b/spec/rubocop/cop/style/unpack_first_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::UnpackFirst, :config do - subject(:cop) { described_class.new(config) } - context 'registers offense' do it 'when using `#unpack` with `#first`' do expect_offense(<<~RUBY) diff --git a/spec/rubocop/cop/style/word_array_spec.rb b/spec/rubocop/cop/style/word_array_spec.rb index c76ab4df261..240fa2ce8d7 100644 --- a/spec/rubocop/cop/style/word_array_spec.rb +++ b/spec/rubocop/cop/style/word_array_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::WordArray, :config do - subject(:cop) { described_class.new(config) } - before do # Reset data which is shared by all instances of WordArray described_class.largest_brackets = -Float::INFINITY diff --git a/spec/rubocop/cop/style/yoda_condition_spec.rb b/spec/rubocop/cop/style/yoda_condition_spec.rb index c2c58cf1bec..c41a9dbbe2f 100644 --- a/spec/rubocop/cop/style/yoda_condition_spec.rb +++ b/spec/rubocop/cop/style/yoda_condition_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::YodaCondition, :config do - subject(:cop) { described_class.new(config) } - let(:error_message) { 'Reverse the order of the operands `%s`.' } shared_examples 'accepts' do |code|