From 7bf1612c87edadf880ef0f80f364d9ac1198f350 Mon Sep 17 00:00:00 2001 From: sodacris Date: Wed, 4 Dec 2024 18:25:35 +0800 Subject: [PATCH] [rubygems/rubygems] unskip `print_args` and `fake_man` tests on Windows https://github.com/rubygems/rubygems/commit/c8eeb0af9d --- spec/bundler/commands/exec_spec.rb | 3 +-- spec/bundler/support/helpers.rb | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 0ab354198f..7e75fe5c49 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -403,8 +403,6 @@ RSpec.describe "bundle exec" do each_prefix.call("exec") do |exec| describe "when #{exec} is used" do before(:each) do - skip "https://github.com/rubygems/rubygems/issues/3351" if Gem.win_platform? - install_gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -435,6 +433,7 @@ RSpec.describe "bundle exec" do it "shows executable's man page when the executable has a -" do FileUtils.mv(bundled_app("print_args"), bundled_app("docker-template")) + FileUtils.mv(bundled_app("print_args.bat"), bundled_app("docker-template.bat")) if Gem.win_platform? bundle "#{exec} docker-template build discourse --help" expect(out).to eq('args: ["build", "discourse", "--help"]') end diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb index af45c7e425..294b932ea1 100644 --- a/spec/bundler/support/helpers.rb +++ b/spec/bundler/support/helpers.rb @@ -384,12 +384,11 @@ module Spec end def with_fake_man - skip "fake_man is not a Windows friendly binstub" if Gem.win_platform? - FileUtils.mkdir_p(tmp("fake_man")) - File.open(tmp("fake_man/man"), "w", 0o755) do |f| - f.puts "#!/usr/bin/env ruby\nputs ARGV.inspect\n" - end + create_file(tmp("fake_man/man"), <<~SCRIPT) + #!/usr/bin/env ruby + puts ARGV.inspect + SCRIPT with_path_added(tmp("fake_man")) { yield } end