From 151b8a68c4964c998dad3ffd1a8c67048e2696aa Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Thu, 10 Dec 2020 18:23:19 +0900 Subject: [PATCH] Fix a build error Follow https://github.com/rubocop-hq/rubocop/pull/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 ' # ./spec/project_spec.rb:53:in `block (4 levels) in ' # ./spec/project_spec.rb:52:in `each' # ./spec/project_spec.rb:52:in `block (3 levels) in ' ``` --- spec/project_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/project_spec.rb b/spec/project_spec.rb index f0e2b10bd1..e53a18da63 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -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)