diff options
Diffstat (limited to 'spec/rubocop/cop/performance/ar_count_each_spec.rb')
-rw-r--r-- | spec/rubocop/cop/performance/ar_count_each_spec.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/spec/rubocop/cop/performance/ar_count_each_spec.rb b/spec/rubocop/cop/performance/ar_count_each_spec.rb index 4aeb9e13b18..a86b3f2b983 100644 --- a/spec/rubocop/cop/performance/ar_count_each_spec.rb +++ b/spec/rubocop/cop/performance/ar_count_each_spec.rb @@ -1,14 +1,12 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'rubocop_spec_helper' require_relative '../../../../rubocop/cop/performance/ar_count_each' RSpec.describe RuboCop::Cop::Performance::ARCountEach do - subject(:cop) { described_class.new } - context 'when it is not haml file' do it 'does not flag it as an offense' do - expect(subject).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(false) + expect(cop).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(false) expect_no_offenses <<~SOURCE show(@users.count) @@ -19,7 +17,7 @@ RSpec.describe RuboCop::Cop::Performance::ARCountEach do context 'when it is haml file' do before do - expect(subject).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(true) + expect(cop).to receive(:in_haml_file?).with(anything).at_least(:once).and_return(true) end context 'when the same object uses count and each' do |