@@ -126,7 +126,7 @@ def test_uses_same_bundler_version_as_main_app
126126 stringio
127127
128128 BUNDLED WITH
129- 4.0.0.beta1
129+ 4.0.0
130130 LOCKFILE
131131 File . write ( File . join ( dir , "Gemfile.lock" ) , lockfile_contents )
132132
@@ -140,7 +140,7 @@ def test_uses_same_bundler_version_as_main_app
140140 launch ( dir , "ruby-lsp" )
141141 end
142142
143- assert_match ( /BUNDLED WITH\n \s *4.0.0.beta1 / , File . read ( File . join ( dir , ".ruby-lsp" , "Gemfile.lock" ) ) )
143+ assert_match ( /BUNDLED WITH\n \s *4.0.0/ , File . read ( File . join ( dir , ".ruby-lsp" , "Gemfile.lock" ) ) )
144144 end
145145 end
146146
@@ -165,7 +165,7 @@ def test_does_not_use_custom_binstubs_if_they_are_in_the_path
165165 stringio
166166
167167 BUNDLED WITH
168- 4.0.0.beta1
168+ 4.0.0
169169 LOCKFILE
170170 File . write ( File . join ( dir , "Gemfile.lock" ) , lockfile_contents )
171171
@@ -187,7 +187,7 @@ def test_does_not_use_custom_binstubs_if_they_are_in_the_path
187187 launch ( dir , "ruby-lsp" , { "PATH" => "#{ bin_path } #{ File ::PATH_SEPARATOR } #{ ENV [ "PATH" ] } " } )
188188 end
189189
190- assert_match ( /BUNDLED WITH\n \s *4.0.0.beta1 / , File . read ( File . join ( dir , ".ruby-lsp" , "Gemfile.lock" ) ) )
190+ assert_match ( /BUNDLED WITH\n \s *4.0.0/ , File . read ( File . join ( dir , ".ruby-lsp" , "Gemfile.lock" ) ) )
191191 end
192192 end
193193
@@ -233,7 +233,7 @@ def test_launch_mode_with_full_bundle
233233 stringio
234234
235235 BUNDLED WITH
236- 2.5.7
236+ 4.0.0
237237 LOCKFILE
238238 File . write ( File . join ( dir , "Gemfile.lock" ) , lockfile_contents )
239239
@@ -353,7 +353,7 @@ def test_launch_mode_update_does_not_modify_main_lockfile
353353 ruby-lsp-rails
354354
355355 BUNDLED WITH
356- 4.0.0.beta1
356+ 4.0.0
357357 LOCKFILE
358358 File . write ( File . join ( dir , "Gemfile.lock" ) , lockfile_contents )
359359
@@ -472,9 +472,9 @@ def launch(workspace_path, exec = "ruby-lsp-launcher", extra_env = {})
472472 } )
473473
474474 # First message is the log of initializing Ruby LSP
475- read_message ( stdout )
475+ read_message ( stdout , stderr )
476476 # Verify that initialization didn't fail
477- initialize_response = read_message ( stdout )
477+ initialize_response = read_message ( stdout , stderr )
478478 refute ( initialize_response [ :error ] , initialize_response . dig ( :error , :message ) )
479479
480480 send_message ( stdin , { id : 2 , method : "shutdown" } )
@@ -504,8 +504,10 @@ def send_message(stdin, message)
504504 stdin . flush
505505 end
506506
507- def read_message ( stdout )
507+ def read_message ( stdout , stderr )
508508 headers = stdout . gets ( "\r \n \r \n " )
509+ flunk ( stderr . read ) unless headers
510+
509511 length = headers [ /Content-Length: (\d +)/i , 1 ] . to_i
510512 JSON . parse ( stdout . read ( length ) , symbolize_names : true )
511513 end
0 commit comments