From c9af0b5323bf33d6d5e78ee397493974ac48b2d0 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 13 Sep 2020 15:30:05 +0900 Subject: [PATCH] Suppress RuboCop's offense Follow https://github.com/rubocop-hq/rubocop/pull/8707 This PR suppresses the following RuboCop's offense. ```console % bundle exec rake (snip) Offenses: spec/rubocop/cop/active_record_helper_spec.rb:6:3: W: Lint/ConstantDefinitionInBlock: Do not define constants within a block. module RuboCop ... ^^^^^^^^^^^^^^ 185 files inspected, 1 offense detected, 1 offense auto-correctable RuboCop failed! ``` --- spec/rubocop/cop/active_record_helper_spec.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/spec/rubocop/cop/active_record_helper_spec.rb b/spec/rubocop/cop/active_record_helper_spec.rb index b6b3932f05..cb413e1cda 100644 --- a/spec/rubocop/cop/active_record_helper_spec.rb +++ b/spec/rubocop/cop/active_record_helper_spec.rb @@ -3,16 +3,8 @@ RSpec.describe RuboCop::Cop::ActiveRecordHelper, :isolated_environment do include FileHelper - module RuboCop - module Cop - class Example < Cop - include ActiveRecordHelper - end - end - end - let(:cop) do - RuboCop::Cop::Example.new + Class.new.extend RuboCop::Cop::ActiveRecordHelper end let(:schema_path) { 'db/schema.rb' }