File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,23 @@ module RubyLsp
7
7
module Rails
8
8
class IndexingEnhancementTest < ActiveSupport ::TestCase
9
9
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.
12
11
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
18
15
end
19
16
end
20
17
21
18
def setup
22
19
@index = self . class . populated_index
23
20
end
24
21
22
+ def teardown
23
+ # Prevent state leaking between tests
24
+ @index = nil
25
+ end
26
+
25
27
test "ClassMethods module inside concerns are automatically extended" do
26
28
@index . index_single ( RubyIndexer ::IndexablePath . new ( nil , "/fake.rb" ) , <<~RUBY )
27
29
module Verifiable
@@ -69,7 +71,7 @@ class Post
69
71
module Verifiable
70
72
extend ActiveSupport::Concern
71
73
72
- class_methods
74
+ # class_methods
73
75
end
74
76
75
77
class Post
You can’t perform that action at this time.
0 commit comments