From 50dbe8c5731cf0b78661c5b5969ea42cdec630da Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Wed, 13 May 2020 14:47:02 -0400 Subject: [PATCH] Can't fool me This spec would fail with the modern implementation... --- spec/rubocop/cop/cop_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/rubocop/cop/cop_spec.rb b/spec/rubocop/cop/cop_spec.rb index e1ad34a91e69..b33f87a8cfb7 100644 --- a/spec/rubocop/cop/cop_spec.rb +++ b/spec/rubocop/cop/cop_spec.rb @@ -171,7 +171,9 @@ context 'when offense was corrected' do before do allow(cop).to receive(:autocorrect?).and_return(true) - allow(cop).to receive(:autocorrect).and_return(->(_corrector) {}) + allow(cop).to receive(:autocorrect).and_return(->(corrector) do + corrector.insert_before(location, 'hi!') + end) end it 'is set to true' do