Skip to content

Commit

Permalink
Upgrade rubocop-rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
bquorning authored and bbatsov committed Feb 14, 2021
1 parent 708eb90 commit dcd8b7d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
31 changes: 15 additions & 16 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-06-12 17:42:47 UTC using RuboCop version 0.85.1.
# on 2021-02-14 15:55:26 UTC using RuboCop version 1.9.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 79
# Offense count: 97
InternalAffairs/NodeDestructuring:
Enabled: false

# Offense count: 48
# Configuration parameters: CountComments.
# Offense count: 57
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 193
Max: 187

# Offense count: 198
# Configuration parameters: CountComments, ExcludedMethods.
# Offense count: 254
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 14

# Offense count: 8
# Configuration parameters: CountComments.
# Offense count: 5
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 135

# Offense count: 10
RSpec/AnyInstance:
Exclude:
- 'spec/rubocop/cli_spec.rb'
- 'spec/rubocop/config_obsoletion_spec.rb'
- 'spec/rubocop/cop/lint/duplicate_methods_spec.rb'
- 'spec/rubocop/cop/team_spec.rb'
- 'spec/rubocop/target_finder_spec.rb'

# Offense count: 981
# Offense count: 1119
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false

# Offense count: 3810
# Offense count: 5579
# Configuration parameters: Max.
RSpec/ExampleLength:
Enabled: false

# Offense count: 38
# Offense count: 39
RSpec/ExpectOutput:
Exclude:
- 'spec/rubocop/cli/cli_auto_gen_config_spec.rb'
- 'spec/rubocop/cli/cli_options_spec.rb'
- 'spec/rubocop/cli/auto_gen_config_spec.rb'
- 'spec/rubocop/cli/options_spec.rb'
- 'spec/rubocop/config_spec.rb'
- 'spec/rubocop/cop/cop_spec.rb'
- 'spec/rubocop/formatter/disabled_config_formatter_spec.rb'
Expand All @@ -59,7 +58,7 @@ RSpec/ExpectOutput:
- 'spec/rubocop/result_cache_spec.rb'
- 'spec/rubocop/target_finder_spec.rb'

# Offense count: 434
# Offense count: 365
RSpec/MultipleExpectations:
Max: 25

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end
gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.7'
gem 'rubocop-performance', '~> 1.9.0'
gem 'rubocop-rspec', '~> 2.0.0'
gem 'rubocop-rspec', '~> 2.2.0'
# Workaround for cc-test-reporter with SimpleCov 0.18.
# Stop upgrading SimpleCov until the following issue will be resolved.
# https://github.com/codeclimate/test-reporter/issues/418
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'timeout'

RSpec.describe RuboCop::CLI, :isolated_environment do
subject(:cli) { described_class.new }
RSpec.describe 'RuboCop::CLI --auto-gen-config', :isolated_environment do # rubocop:disable RSpec/DescribeClass
subject(:cli) { RuboCop::CLI.new }

include_context 'cli spec behavior'

Expand Down Expand Up @@ -63,7 +63,7 @@ def f
YAML
expect(IO.read('.rubocop.yml').strip).to eq(exp_dotfile.join($RS))
$stdout = StringIO.new
expect(described_class.new.run([])).to eq(0)
expect(RuboCop::CLI.new.run([])).to eq(0)
expect($stderr.string).to eq('')
expect($stdout.string).to include('no offenses detected')
end
Expand Down Expand Up @@ -191,7 +191,7 @@ def f
Enabled: true
YAML
$stdout = StringIO.new
expect(described_class.new.run(%w[--format simple --debug])).to eq(1)
expect(RuboCop::CLI.new.run(%w[--format simple --debug])).to eq(1)
expect($stdout.string)
.to include('.rubocop.yml: Layout/LineLength:Max overrides the ' \
"same parameter in .rubocop_todo.yml\n")
Expand Down Expand Up @@ -245,7 +245,7 @@ def f
Enabled: false
YAML
$stdout = StringIO.new
expect(described_class.new.run(%w[--format simple])).to eq(0)
expect(RuboCop::CLI.new.run(%w[--format simple])).to eq(0)
expect($stderr.string).to eq('')
expect($stdout.string).to eq(<<~OUTPUT)
Expand Down Expand Up @@ -295,7 +295,7 @@ def f
Enabled: true
YAML
$stdout = StringIO.new
expect(described_class.new.run(%w[--format simple])).to eq(0)
expect(RuboCop::CLI.new.run(%w[--format simple])).to eq(0)
expect($stderr.string).to eq('')
expect($stdout.string).to eq(<<~OUTPUT)
Expand Down Expand Up @@ -345,7 +345,7 @@ def f
' Max: 125'])

# Create new CLI instance to avoid using cached configuration.
new_cli = described_class.new
new_cli = RuboCop::CLI.new

expect(new_cli.run(['example1.rb'])).to eq(0)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe RuboCop::CLI, :isolated_environment do
subject(:cli) { described_class.new }
RSpec.describe 'RuboCop::CLI --autocorrect', :isolated_environment do # rubocop:disable RSpec/DescribeClass
subject(:cli) { RuboCop::CLI.new }

include_context 'cli spec behavior'

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

RSpec.describe RuboCop::CLI, :isolated_environment do
subject(:cli) { described_class.new }
RSpec.describe 'RuboCop::CLI --disable-uncorrectable', :isolated_environment do # rubocop:disable RSpec/DescribeClass
subject(:cli) { RuboCop::CLI.new }

include_context 'cli spec behavior'

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

RSpec.describe RuboCop::CLI, :isolated_environment do
subject(:cli) { described_class.new }
RSpec.describe 'RuboCop::CLI options', :isolated_environment do # rubocop:disable RSpec/DescribeClass
subject(:cli) { RuboCop::CLI.new }

include_context 'cli spec behavior'

Expand Down

0 comments on commit dcd8b7d

Please sign in to comment.