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-rails
% bundle exec rspec spec/project_spec.rb
(snip)

Failures:

  1) RuboCop Rails Project default configuration file has a
  SupportedStyles for all EnforcedStyle and EnforcedStyle is valid
     Failure/Error: subject(:config) {
  RuboCop::ConfigLoader.load_file('config/default.yml') }

     RuboCop::ValidationError:
       `Rails` cops have been extracted to the `rubocop-rails` 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:53:in `block (4 levels) in
       <top (required)>'
     # ./spec/project_spec.rb:52:in `each'
     # ./spec/project_spec.rb:52:in `block (3 levels) in <top (required)>'
```
  • Loading branch information
koic committed Dec 10, 2020
1 parent 209e963 commit 151b8a6
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-rails') # rubocop:disable RSpec/AnyInstance
end

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

0 comments on commit 151b8a6

Please sign in to comment.