Skip to content

Commit

Permalink
Update RuboCop/RSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Oct 16, 2020
1 parent 13df023 commit 7f57dc4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,15 @@ RSpec/MessageSpies:

RSpec/NestedGroups:
Max: 7

RSpec/MultipleMemoizedHelpers:
Enabled: false

# Buggy cop
# See https://github.com/rubocop-hq/rubocop-rspec/pull/1018
RSpec/EmptyExampleGroup:
Exclude:
- 'spec/rubocop/cli/cli_options_spec.rb'
- 'spec/rubocop/cop/lint/script_permission_spec.rb'
- 'spec/rubocop/cop/style/empty_else_spec.rb'
- 'spec/rubocop/result_cache_spec.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'pry'
gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.7'
gem 'rubocop-performance', '~> 1.7.0'
gem 'rubocop-rspec', '~> 1.39.0'
gem 'rubocop-rspec', '~> 1.43.2'
# 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
4 changes: 2 additions & 2 deletions spec/rubocop/cli/cli_auto_gen_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
require 'timeout'

RSpec.describe RuboCop::CLI, :isolated_environment do
include_context 'cli spec behavior'

subject(:cli) { described_class.new }

include_context 'cli spec behavior'

describe '--auto-gen-config' do
before do
RuboCop::Formatter::DisabledConfigFormatter
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli/cli_autocorrect_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

RSpec.describe RuboCop::CLI, :isolated_environment do
include_context 'cli spec behavior'

subject(:cli) { described_class.new }

include_context 'cli spec behavior'

before do
RuboCop::ConfigLoader.default_configuration = nil
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli/cli_disable_uncorrectable_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

RSpec.describe RuboCop::CLI, :isolated_environment do
include_context 'cli spec behavior'

subject(:cli) { described_class.new }

include_context 'cli spec behavior'

describe '--disable-uncorrectable' do
let(:exit_code) do
cli.run(%w[--auto-correct-all --format simple --disable-uncorrectable])
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli/cli_options_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

RSpec.describe RuboCop::CLI, :isolated_environment do
include_context 'cli spec behavior'

subject(:cli) { described_class.new }

include_context 'cli spec behavior'

let(:rubocop) { "#{RuboCop::ConfigLoader::RUBOCOP_HOME}/exe/rubocop" }

before do
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
require 'timeout'

RSpec.describe RuboCop::CLI, :isolated_environment do
include_context 'cli spec behavior'

subject(:cli) { described_class.new }

include_context 'cli spec behavior'

context 'when interrupted' do
it 'returns 130' do
allow_any_instance_of(RuboCop::Runner)
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/runner_formatter_invocation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

RSpec.describe RuboCop::Runner, :isolated_environment do
describe 'how formatter is invoked' do
include_context 'cli spec behavior'

subject(:runner) { described_class.new({}, RuboCop::ConfigStore.new) }

include_context 'cli spec behavior'

let(:formatter) do
instance_double(RuboCop::Formatter::BaseFormatter).as_null_object
end
Expand Down

0 comments on commit 7f57dc4

Please sign in to comment.