Skip to content

Commit a62c3a9

Browse files
Earlopainbbatsov
authored andcommitted
Fix flaky spec for rubocop_extra_features
It's not safe to assume that it is always nil when the test starts since other tests could already have accessed it. I believe it's also not testing much, except that this method is indeed using a instance variable, so I opted to remove the test. Writing something that really tests this seems very difficult. Followup to #14414
1 parent bf3806e commit a62c3a9

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

spec/rubocop/result_cache_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -479,20 +479,4 @@ def abs(path)
479479
end
480480
end
481481
end
482-
483-
describe '#rubocop_extra_features' do
484-
it 'memoizes the value in @rubocop_extra_features' do
485-
expect(cache.instance_variable_get(:@rubocop_extra_features)).to be_nil
486-
487-
first_result = cache.send(:rubocop_extra_features)
488-
489-
expect(cache.instance_variable_get(:@rubocop_extra_features)).to equal(first_result)
490-
491-
sentinel = Object.new
492-
cache.instance_variable_set(:@rubocop_extra_features, sentinel)
493-
494-
second_result = cache.send(:rubocop_extra_features)
495-
expect(second_result).to equal(sentinel)
496-
end
497-
end
498482
end

0 commit comments

Comments
 (0)