Skip to content

Commit cc4d840

Browse files
committed
DEBUG
1 parent 66643c5 commit cc4d840

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/integration_test.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
class IntegrationTest < Minitest::Test
77
def setup
8+
Bundler.reset!
9+
Bundler.setup
810
@bundle_path = Bundler.bundle_path.to_s
911
end
1012

@@ -472,9 +474,9 @@ def launch(workspace_path, exec = "ruby-lsp-launcher", extra_env = {})
472474
})
473475

474476
# First message is the log of initializing Ruby LSP
475-
read_message(stdout)
477+
read_message(stdout, stderr)
476478
# Verify that initialization didn't fail
477-
initialize_response = read_message(stdout)
479+
initialize_response = read_message(stdout, stderr)
478480
refute(initialize_response[:error], initialize_response.dig(:error, :message))
479481

480482
send_message(stdin, { id: 2, method: "shutdown" })
@@ -504,8 +506,10 @@ def send_message(stdin, message)
504506
stdin.flush
505507
end
506508

507-
def read_message(stdout)
509+
def read_message(stdout, stderr)
508510
headers = stdout.gets("\r\n\r\n")
511+
flunk(stderr.read) unless headers
512+
509513
length = headers[/Content-Length: (\d+)/i, 1].to_i
510514
JSON.parse(stdout.read(length), symbolize_names: true)
511515
end

0 commit comments

Comments
 (0)