From 203310b4050be58cd2290bb84b473ff2e5d384c0 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Sun, 24 May 2020 21:10:19 +0200 Subject: [PATCH] Remove explicit `subject(:cop)` from specs In https://github.com/rubocop-hq/rubocop/pull/7970 the shared context `config` was updated to include the following: let(:cop) do cop_class.new(config, cop_options) .tap { |cop| cop.processed_source = processed_source } end This is functionally equivalent to what we have all over our specs: subject(:cop) { described_class.new(config) } The downside is that our specs become a less explicit. Actually they now have a mystery guest, which may be considered a smell. --- spec/rubocop/cop/factory_bot/create_list_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/rubocop/cop/factory_bot/create_list_spec.rb b/spec/rubocop/cop/factory_bot/create_list_spec.rb index 31e08eaa..10af6187 100644 --- a/spec/rubocop/cop/factory_bot/create_list_spec.rb +++ b/spec/rubocop/cop/factory_bot/create_list_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::RSpec::FactoryBot::CreateList, :config do - subject(:cop) { described_class.new(config) } - let(:cop_config) do { 'EnforcedStyle' => enforced_style } end