diff options
| author | Alex Robbin <alex.robbin@huntclub.com> | 2024-03-29 12:23:24 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-03-29 19:27:28 +0000 |
| commit | d7d59ea172384cac5eae63b39b61c3f09c1f43e3 (patch) | |
| tree | d0af31011afae0e227c879cdbd298661a7addef2 | |
| parent | f57c7fef6b260ca7d04458efd2f9e9fd784c9d89 (diff) | |
[rubygems/rubygems] add test case to ensure updating with multiple sources + caching maintains the right lockfile
https://github.com/rubygems/rubygems/commit/65839757e6
| -rw-r--r-- | spec/bundler/commands/update_spec.rb | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 2a09e0531b..cfb86ebb54 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -864,6 +864,90 @@ RSpec.describe "bundle update" do expect(exitstatus).to eq(22) end + context "with multiple sources and caching enabled" do + before do + build_repo2 do + build_gem "rack", "1.0.0" + + build_gem "request_store", "1.0.0" do |s| + s.add_dependency "rack", "1.0.0" + end + end + + build_repo4 do + # set up repo with no gems + end + + gemfile <<~G + source "#{file_uri_for(gem_repo2)}" + + gem "request_store" + + source "#{file_uri_for(gem_repo4)}" do + end + G + + lockfile <<~L + GEM + remote: #{file_uri_for(gem_repo2)}/ + specs: + rack (1.0.0) + request_store (1.0.0) + rack (= 1.0.0) + + GEM + remote: #{file_uri_for(gem_repo4)}/ + specs: + + PLATFORMS + #{local_platform} + + DEPENDENCIES + request_store + + BUNDLED WITH + #{Bundler::VERSION} + L + end + + it "works" do + bundle :install + bundle :cache + + update_repo2 do + build_gem "request_store", "1.1.0" do |s| + s.add_dependency "rack", "1.0.0" + end + end + + bundle "update request_store" + + expect(out).to include("Bundle updated!") + + expect(lockfile).to eq <<~L + GEM + remote: #{file_uri_for(gem_repo2)}/ + specs: + rack (1.0.0) + request_store (1.1.0) + rack (= 1.0.0) + + GEM + remote: #{file_uri_for(gem_repo4)}/ + specs: + + PLATFORMS + #{local_platform} + + DEPENDENCIES + request_store + + BUNDLED WITH + #{Bundler::VERSION} + L + end + end + context "with multiple, duplicated sources, with lockfile in old format", bundler: "< 3" do before do build_repo2 do |
