diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-07-22 11:35:15 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-07-27 09:25:55 +0900 |
commit | 4271f4aea5a49775cb904beffeda8d0c37ddbe64 (patch) | |
tree | 1e675081386aa54932b85ed5853218cc661fb5c7 /spec/bundler | |
parent | 90899c50c2890a70e7ce812a41f88b878ec50adc (diff) |
[rubygems/rubygems] Fix bundler binstub version selection
To mimic built-in rubygems behaviour, only thing that should be
approximated is the lockfile version. Other alternatives like
`BUNDLER_VERSION` should be respected exactly.
https://github.com/rubygems/rubygems/commit/dbd667d4bc
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/commands/binstubs_spec.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 3b177b32ea..2006485fca 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -140,8 +140,15 @@ RSpec.describe "bundle binstubs <gem>" do it "runs the correct version of bundler" do sys_exec "bin/bundle install", :env => { "BUNDLER_VERSION" => "999.999.999" }, :raise_on_error => false expect(exitstatus).to eq(42) - expect(err).to include("Activating bundler (~> 999.999) failed:"). - and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`") + expect(err).to include("Activating bundler (999.999.999) failed:"). + and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`") + end + + it "runs the correct version of bundler even if a higher version is installed" do + system_gems "bundler-999.999.998", "bundler-999.999.999" + + sys_exec "bin/bundle install", :env => { "BUNDLER_VERSION" => "999.999.998", "DEBUG" => "1" }, :raise_on_error => false + expect(out).to include %(Using bundler 999.999.998\n) end end @@ -215,8 +222,8 @@ RSpec.describe "bundle binstubs <gem>" do it "calls through to the explicit bundler version" do sys_exec "bin/bundle update --bundler=999.999.999", :raise_on_error => false expect(exitstatus).to eq(42) - expect(err).to include("Activating bundler (~> 999.999) failed:"). - and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`") + expect(err).to include("Activating bundler (999.999.999) failed:"). + and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`") end end |