[rubygems/rubygems] Fix bundle check
showing duplicated gems
If the lockfile contains multiple platforms, `bundle check` would show duplicated missing gems. https://github.com/rubygems/rubygems/commit/6ac5931783
This commit is contained in:
parent
e70419d608
commit
f6803d2411
Notes:
git
2021-08-31 19:07:05 +09:00
@ -24,7 +24,7 @@ module Bundler
|
|||||||
|
|
||||||
specs_for_dep = spec_for_dependency(dep, match_current_platform)
|
specs_for_dep = spec_for_dependency(dep, match_current_platform)
|
||||||
if specs_for_dep.any?
|
if specs_for_dep.any?
|
||||||
specs += specs_for_dep
|
match_current_platform ? specs += specs_for_dep : specs |= specs_for_dep
|
||||||
|
|
||||||
specs_for_dep.first.dependencies.each do |d|
|
specs_for_dep.first.dependencies.each do |d|
|
||||||
next if d.type == :development
|
next if d.type == :development
|
||||||
|
@ -332,6 +332,42 @@ RSpec.describe "bundle check" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "when locked under multiple platforms" do
|
||||||
|
before :each do
|
||||||
|
build_repo4 do
|
||||||
|
build_gem "rack"
|
||||||
|
end
|
||||||
|
|
||||||
|
gemfile <<-G
|
||||||
|
source "#{file_uri_for(gem_repo4)}"
|
||||||
|
gem "rack"
|
||||||
|
G
|
||||||
|
|
||||||
|
lockfile <<-L
|
||||||
|
GEM
|
||||||
|
remote: #{file_uri_for(gem_repo4)}/
|
||||||
|
specs:
|
||||||
|
rack (1.0)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
#{specific_local_platform}
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
rack
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
end
|
||||||
|
|
||||||
|
it "shows what is missing with the current Gemfile without duplications" do
|
||||||
|
bundle :check, :raise_on_error => false
|
||||||
|
expect(err).to match(/The following gems are missing/)
|
||||||
|
expect(err).to include("* rack (1.0").once
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "when using only scoped rubygems sources" do
|
describe "when using only scoped rubygems sources" do
|
||||||
before do
|
before do
|
||||||
gemfile <<~G
|
gemfile <<~G
|
||||||
|
Loading…
x
Reference in New Issue
Block a user