Skip to content

Commit

Permalink
Remove explicit subject(:cop) from specs
Browse files Browse the repository at this point in the history
In rubocop/rubocop#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.
  • Loading branch information
bquorning committed May 24, 2020
1 parent b2a4bdc commit bf12fbd
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions 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' } }

Expand Down

0 comments on commit bf12fbd

Please sign in to comment.