From dd473cec29a9bb98705f9782c747264a88bc14f0 Mon Sep 17 00:00:00 2001 From: sodacris Date: Mon, 18 Nov 2024 15:53:34 +0800 Subject: [PATCH] [rubygems/rubygems] Fix binstub test bug the overwritten binstub in the test has a final new line that makes it not match "OMG" exactly from the beginning, that's why the test passes, but `bintubs` command without `--force` flag is not supposed to update the binstub. This change fixes the test to test what's supposed to update the binstub, and also fixes the assertion that that it will fail in the future if `--force` stops updating the binstub. https://github.com/rubygems/rubygems/commit/dfc9023337 --- spec/bundler/runtime/executable_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/bundler/runtime/executable_spec.rb b/spec/bundler/runtime/executable_spec.rb index b11c48539a..cf57805708 100644 --- a/spec/bundler/runtime/executable_spec.rb +++ b/spec/bundler/runtime/executable_spec.rb @@ -126,7 +126,7 @@ RSpec.describe "Running bin/* commands" do expect(bundled_app("bin/myrackup")).to exist end - it "rewrites bins on binstubs (to maintain backwards compatibility)" do + it "rewrites bins on binstubs with --force option" do install_gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -134,9 +134,9 @@ RSpec.describe "Running bin/* commands" do create_file("bin/myrackup", "OMG") - bundle "binstubs myrack" + bundle "binstubs myrack", { force: true } - expect(bundled_app("bin/myrackup").read).to_not eq("OMG") + expect(bundled_app("bin/myrackup").read.strip).to_not eq("OMG") end it "use BUNDLE_GEMFILE gemfile for binstub" do