@@ -317,24 +317,21 @@ def test_creates_composed_bundle_with_specified_branch
317317 end
318318
319319 def test_creates_composed_bundle_with_specified_path
320- Dir . mktmpdir do |dir |
320+ in_temp_dir do |dir |
321321 local_path = File . join ( dir , "local-ruby-lsp" )
322322 FileUtils . mkdir_p ( File . join ( local_path , "lib" ) )
323-
324- Dir . chdir ( dir ) do
325- bundle_gemfile = Pathname . new ( ".ruby-lsp" ) . expand_path ( Dir . pwd ) + "Gemfile"
326- Bundler . with_unbundled_env do
327- stub_bundle_with_env ( bundle_env ( dir , bundle_gemfile . to_s ) )
328- run_script ( File . realpath ( dir ) , lsp_path : local_path )
329- end
330-
331- assert_path_exists ( ".ruby-lsp" )
332- assert_path_exists ( ".ruby-lsp/Gemfile" )
333- assert_match ( %r{ruby-lsp.*path: "#{ Regexp . escape ( local_path ) } "} , File . read ( ".ruby-lsp/Gemfile" ) )
334- assert_match ( "debug" , File . read ( ".ruby-lsp/Gemfile" ) )
323+
324+ Bundler . with_unbundled_env do
325+ stub_bundle_with_env ( bundle_env ( dir , ".ruby-lsp/Gemfile" ) )
326+ run_script ( File . realpath ( dir ) , lsp_path : local_path )
335327 end
328+
329+ assert_path_exists ( ".ruby-lsp" )
330+ assert_path_exists ( ".ruby-lsp/Gemfile" )
331+ assert_match ( %r{ruby-lsp.*path: "#{ Regexp . escape ( local_path ) } "} , File . read ( ".ruby-lsp/Gemfile" ) )
332+ assert_match ( "debug" , File . read ( ".ruby-lsp/Gemfile" ) )
336333 end
337- end
334+ end
338335
339336
340337 def test_returns_bundle_app_config_if_there_is_local_config
0 commit comments