Commit d6c69373 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure it's not offending to use local ||= val

parent 72c489e9
...@@ -70,6 +70,20 @@ describe RuboCop::Cop::Gitlab::PredicateMemoization do ...@@ -70,6 +70,20 @@ describe RuboCop::Cop::Gitlab::PredicateMemoization do
end end
end end
context 'when source is a predicate method using local with ||=' do
it_behaves_like 'not registering offense' do
let(:source) do
<<~RUBY
class C
def really?
really ||= true
end
end
RUBY
end
end
end
context 'when source is a regular method memoizing via ivar' do context 'when source is a regular method memoizing via ivar' do
it_behaves_like 'not registering offense' do it_behaves_like 'not registering offense' do
let(:source) do let(:source) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment