Skip to content

Commit

Permalink
Fix a build error
Browse files Browse the repository at this point in the history
Follow rubocop/rubocop#9197.

This PR fixes the following build error.

```console
% cd path/to/rubocop-performance
% bundle exec rspec spec/project_spec.rb
(snip)

Failures:

  1) RuboCop Performance Project default configuration file has a nicely
  formatted description for all cops
     Failure/Error: subject(:config) {
  RuboCop::ConfigLoader.load_file('config/default.yml') }

     RuboCop::ValidationError:
       `Performance` cops have been extracted to the
       `rubocop-performance` gem.
       (obsolete configuration found in config/default.yml, please
       update it)
     # ./spec/project_spec.rb:5:in `block (3 levels) in
       <top (required)>'
     # ./spec/project_spec.rb:16:in `block (4 levels) in
       <top (required)>'
     # ./spec/project_spec.rb:15:in `each'
     # ./spec/project_spec.rb:15:in `block (3 levels) in <top (required)>'
```
  • Loading branch information
koic committed Dec 10, 2020
1 parent 0d029a7 commit 0e59891
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
describe 'default configuration file' do
subject(:config) { RuboCop::ConfigLoader.load_file('config/default.yml') }

before do
allow_any_instance_of(RuboCop::Config).to receive(:loaded_features).and_return('rubocop-performance') # rubocop:disable RSpec/AnyInstance
end

let(:registry) { RuboCop::Cop::Registry.global }
let(:cop_names) do
registry.with_department(:Performance).cops.map(&:cop_name)
Expand Down

0 comments on commit 0e59891

Please sign in to comment.