Skip to content

Commit e76beed

Browse files
committed
Fix failing test
1 parent de814a0 commit e76beed

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/ruby_lsp_rails/indexing_enhancement_test.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ module RubyLsp
77
module Rails
88
class IndexingEnhancementTest < ActiveSupport::TestCase
99
class << self
10-
# For these tests, it's convenient to have the index fully populated with Rails information, but we don't have
11-
# to reindex on every single example or that will be too slow
10+
# For these tests, it's convenient to have the index fully populated with Rails information.
1211
def populated_index
13-
@index ||= begin
14-
index = RubyIndexer::Index.new
15-
index.index_all
16-
index
17-
end
12+
index = RubyIndexer::Index.new
13+
index.index_all
14+
index
1815
end
1916
end
2017

2118
def setup
2219
@index = self.class.populated_index
2320
end
2421

22+
def teardown
23+
# Prevent state leaking between tests
24+
@index = nil
25+
end
26+
2527
test "ClassMethods module inside concerns are automatically extended" do
2628
@index.index_single(RubyIndexer::IndexablePath.new(nil, "/fake.rb"), <<~RUBY)
2729
module Verifiable
@@ -69,7 +71,7 @@ class Post
6971
module Verifiable
7072
extend ActiveSupport::Concern
7173
72-
class_methods
74+
# class_methods
7375
end
7476
7577
class Post

0 commit comments

Comments
 (0)