Skip to content

Commit afa0fc4

Browse files
authored
Revert GlobalState caching (#4006)
Right now we have consistent test setup within the same test class, so caching the GlobalState within the same test class doesn't leak state. But it's not easy to guarantee this for future tests and it can easily become a footgun. So let's revert it for now.
1 parent 392103a commit afa0fc4

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

test/requests/support/expectations_test_runner.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ class ExpectationsTestRunner < Minitest::Test
88
TEST_PRISM_FIXTURES = File.join(TEST_FIXTURES_DIR, "prism/test/prism/fixtures/**", "*.txt")
99

1010
def setup
11-
@global_state = self.class.shared_global_state
11+
@global_state = RubyLsp::GlobalState.new
1212
end
1313

1414
class << self
15-
def shared_global_state
16-
@shared_global_state ||= RubyLsp::GlobalState.new
17-
end
18-
1915
def expectations_tests(handler_class, expectation_suffix)
2016
class_eval(<<~RB, __FILE__, __LINE__ + 1)
2117
module ExpectationsRunnerMethods

0 commit comments

Comments
 (0)