From 57614e8b9a722b6879d7e9aa9a8f00b9a45656f9 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 12 Dec 2024 13:34:01 -0500 Subject: [PATCH] Fix debug platform inclusion for Windows --- test/setup_bundler_test.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/setup_bundler_test.rb b/test/setup_bundler_test.rb index b7cb8980fd..e872a37b53 100644 --- a/test/setup_bundler_test.rb +++ b/test/setup_bundler_test.rb @@ -823,6 +823,35 @@ def test_is_resilient_to_gemfile_changes_in_the_middle_of_setup end end + def test_composed_bundle_includes_debug + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + File.write(File.join(dir, "Gemfile"), <<~GEMFILE) + source "https://rubygems.org" + GEMFILE + + env = T.let(nil, T.nilable(T::Hash[String, String])) + + Bundler.with_unbundled_env do + capture_subprocess_io do + # Run bundle install to generate the lockfile + system("bundle install") + env = RubyLsp::SetupBundler.new(dir, launcher: true).setup! + end + + gemfile_path = File.join(dir, ".ruby-lsp", "Gemfile") + assert_match("debug", File.read(gemfile_path)) + + _stdout, stderr = capture_subprocess_io do + system(T.must(env), "bundle exec ruby -e 'require \"debug\"'") + end + + assert_empty(stderr) + end + end + end + end + private def with_default_external_encoding(encoding, &block)