From 28431ac97d88910615a140b5164a22066407a456 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/rspec_rails/http_status_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/rubocop/cop/rspec_rails/http_status_spec.rb b/spec/rubocop/cop/rspec_rails/http_status_spec.rb index 410a69c8..d4ca57c8 100644 --- a/spec/rubocop/cop/rspec_rails/http_status_spec.rb +++ b/spec/rubocop/cop/rspec_rails/http_status_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.describe RuboCop::Cop::RSpec::Rails::HttpStatus, :config do - subject(:cop) { described_class.new(config) } - context 'when EnforcedStyle is `symbolic`' do let(:cop_config) { { 'EnforcedStyle' => 'symbolic' } }