diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-07-12 16:08:32 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-07-13 11:36:03 +0900 |
commit | f16c880f776450771196c35cec10b9a5860a560f (patch) | |
tree | 0a5b3852cc1c53746ff97402891e37ae77d97bc8 /spec | |
parent | 8f61a4c5b2f26df3a487c1a77b24488b437e793c (diff) | |
download | ruby-f16c880f776450771196c35cec10b9a5860a560f.tar.gz |
[rubygems/rubygems] Introduce bundle config set version feature
https://github.com/rubygems/rubygems/commit/c431a1df52
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/runtime/self_management_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/bundler/runtime/self_management_spec.rb b/spec/bundler/runtime/self_management_spec.rb index 700084babf..248555355c 100644 --- a/spec/bundler/runtime/self_management_spec.rb +++ b/spec/bundler/runtime/self_management_spec.rb @@ -103,6 +103,25 @@ RSpec.describe "Self management", :rubygems => ">= 3.3.0.dev", :realworld => tru expect(out).to eq(Bundler::VERSION[0] == "2" ? "Bundler version #{Bundler::VERSION}" : Bundler::VERSION) end + it "installs BUNDLE_VERSION version when using bundle config version x.y.z" do + lockfile_bundled_with(Bundler::VERSION.gsub(/\.dev/, "")) + + bundle "config set --local version #{previous_minor}" + bundle "install", :artifice => "vcr" + expect(out).to include("Bundler #{Bundler::VERSION} is running, but your configuration was #{previous_minor}. Installing Bundler #{previous_minor} and restarting using that version.") + end + + it "does not try to install when using bundle config version global" do + lockfile_bundled_with(previous_minor) + + bundle "config set version global" + bundle "install", :artifice => "vcr" + expect(out).not_to match(/restarting using that version/) + + bundle "-v" + expect(out).to eq(Bundler::VERSION[0] == "2" ? "Bundler version #{Bundler::VERSION}" : Bundler::VERSION) + end + private def lockfile_bundled_with(version) |