Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb')
-rw-r--r--spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
index 3c3aa5b7b5c..ac59d36db3f 100644
--- a/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
+++ b/spec/rubocop/cop/avoid_break_from_strong_memoize_spec.rb
@@ -5,8 +5,6 @@ require 'rubocop'
require_relative '../../../rubocop/cop/avoid_break_from_strong_memoize'
RSpec.describe RuboCop::Cop::AvoidBreakFromStrongMemoize do
- include CopHelper
-
subject(:cop) { described_class.new }
it 'flags violation for break inside strong_memoize' do
@@ -56,7 +54,7 @@ RSpec.describe RuboCop::Cop::AvoidBreakFromStrongMemoize do
call do
strong_memoize(:result) do
break if something
-
+ ^^^^^ Do not use break inside strong_memoize, use next instead.
do_an_heavy_calculation
end
end
@@ -65,7 +63,7 @@ RSpec.describe RuboCop::Cop::AvoidBreakFromStrongMemoize do
expect(instance).to receive(:add_offense).once
end
- inspect_source(source)
+ expect_offense(source)
end
it "doesn't check when block is empty" do