diff options
author | sodacris <[email protected]> | 2024-11-18 15:53:34 +0800 |
---|---|---|
committer | git <[email protected]> | 2024-11-19 12:56:01 +0000 |
commit | dd473cec29a9bb98705f9782c747264a88bc14f0 (patch) | |
tree | 4bf474aaa74f2cff88c48dc4313b04fd8f284d73 | |
parent | 492b379b52a8c35c53038cde35c506cde2776834 (diff) |
[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
-rw-r--r-- | spec/bundler/runtime/executable_spec.rb | 6 |
1 files 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 |