Skip to content

Commit 3cd0084

Browse files
committed
DEBUG
1 parent 66643c5 commit 3cd0084

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/integration_test.rb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
class IntegrationTest < Minitest::Test
77
def setup
88
@bundle_path = Bundler.bundle_path.to_s
9+
Bundler.reset!
10+
end
11+
12+
def teardown
13+
Bundler.reset!
14+
Bundler.setup
915
end
1016

1117
def test_ruby_lsp_doctor_works
@@ -472,9 +478,9 @@ def launch(workspace_path, exec = "ruby-lsp-launcher", extra_env = {})
472478
})
473479

474480
# First message is the log of initializing Ruby LSP
475-
read_message(stdout)
481+
read_message(stdout, stderr)
476482
# Verify that initialization didn't fail
477-
initialize_response = read_message(stdout)
483+
initialize_response = read_message(stdout, stderr)
478484
refute(initialize_response[:error], initialize_response.dig(:error, :message))
479485

480486
send_message(stdin, { id: 2, method: "shutdown" })
@@ -504,8 +510,10 @@ def send_message(stdin, message)
504510
stdin.flush
505511
end
506512

507-
def read_message(stdout)
513+
def read_message(stdout, stderr)
508514
headers = stdout.gets("\r\n\r\n")
515+
flunk(stderr.read) unless headers
516+
509517
length = headers[/Content-Length: (\d+)/i, 1].to_i
510518
JSON.parse(stdout.read(length), symbolize_names: true)
511519
end

0 commit comments

Comments
 (0)