Skip to content

Commit bd70871

Browse files
committed
Test structure was stale. Update to conform to recent changes in main...
Specifically, PR 3840 updated bundler and required changes to test setup. #3840
1 parent f2e11fd commit bd70871

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

test/setup_bundler_test.rb

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)