Skip to content

Commit

Permalink
Use RuboCop RSpec 2.24
Browse files Browse the repository at this point in the history
This commit uses RuboCop RSpec 2.24 and suppresses the following `RSpec/FilePath` error:

```console
$ bundle exec rubocop
Error: The `RSpec/FilePath` cop has been split into `RSpec/SpecFilePathFormat` and `RSpec/SpecFilePathSuffix`.
(obsolete configuration found in .rubocop.yml, please update it)
```

https://github.com/rubocop/rubocop-rspec/releases/tag/v2.24.0
  • Loading branch information
koic committed Sep 8, 2023
1 parent 4ba4104 commit aab9391
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 7 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ RSpec:
- expect_no_offenses
- expect_offense

RSpec/FilePath:
Exclude:
- spec/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new_spec.rb
- spec/rubocop/formatter/junit_formatter_spec.rb

RSpec/PredicateMatcher:
EnforcedStyle: explicit

RSpec/SpecFilePathFormat:
CustomTransform:
JUnitFormatter: junit_formatter
RedundantLetRuboCopConfigNew: redundant_let_rubocop_config_new
Exclude:
- spec/rubocop/cop/mixin/enforce_superclass_spec.rb

RSpec/MessageSpies:
EnforcedStyle: receive

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.7'
gem 'rubocop-performance', '~> 1.19.0'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec', '~> 2.23.0'
gem 'rubocop-rspec', '~> 2.24.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
2 changes: 0 additions & 2 deletions spec/rubocop/cop/mixin/enforce_superclass_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

# rubocop:disable RSpec/FilePath
RSpec.describe RuboCop::Cop::EnforceSuperclass, :restore_registry do
subject(:cop) { cop_class.new(configuration) }

Expand Down Expand Up @@ -117,4 +116,3 @@ class MyModel < ::ActiveRecord::Base
RUBY
end
end
# rubocop:enable RSpec/FilePath

0 comments on commit aab9391

Please sign in to comment.