From aa27c62f39d87c6c26989b1f9af3a870b4643db8 Mon Sep 17 00:00:00 2001 From: John Backus Date: Sun, 18 Sep 2016 23:51:46 -0700 Subject: [PATCH] Remove unused doubled methods (#3509) These methods can be safely removed from their test doubles without breaking the test case. --- spec/rubocop/cop/commissioner_spec.rb | 2 +- spec/rubocop/formatter/worst_offenders_formatter_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/rubocop/cop/commissioner_spec.rb b/spec/rubocop/cop/commissioner_spec.rb index 6875ea726337..a9a6367aa36e 100644 --- a/spec/rubocop/cop/commissioner_spec.rb +++ b/spec/rubocop/cop/commissioner_spec.rb @@ -24,7 +24,7 @@ it 'returns all offenses except the ones of the cop' do cops = [] cops << double('cop A', offenses: %w(foo), excluded_file?: false) - cops << double('cop B', offenses: %w(bar), excluded_file?: true) + cops << double('cop B', excluded_file?: true) cops << double('cop C', offenses: %w(baz), excluded_file?: false) cops.each(&:as_null_object) diff --git a/spec/rubocop/formatter/worst_offenders_formatter_spec.rb b/spec/rubocop/formatter/worst_offenders_formatter_spec.rb index c370eeb52f7e..1c158d88ff04 100644 --- a/spec/rubocop/formatter/worst_offenders_formatter_spec.rb +++ b/spec/rubocop/formatter/worst_offenders_formatter_spec.rb @@ -17,7 +17,7 @@ module Formatter describe '#finished' do context 'when there are many offenses' do - let(:offense) { double('offense', cop_name: 'SomeCop') } + let(:offense) { double('offense') } before do formatter.started(files)