File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
spec/bundler/install/gemfile Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -1077,7 +1077,7 @@ def converge_specs(specs)
10771077 end
10781078 end
10791079
1080- if parent_dep
1080+ if parent_dep && parent_dep . source . is_a? ( Source :: Path )
10811081 replacement_source = parent_dep . source
10821082 else
10831083 replacement_source = sources . get ( lockfile_source )
Original file line number Diff line number Diff line change 11951195 expect ( gem_section ) . not_to include ( "activerecord (7.0.0)" )
11961196 end
11971197 end
1198+
1199+ context "when a scoped rubygems source is missing a transitive dependency" do
1200+ before do
1201+ build_repo2 do
1202+ build_gem "fallback_dep" , "1.0.0"
1203+ build_gem "foo" , "1.0.0"
1204+ end
1205+
1206+ build_repo3 do
1207+ build_gem "private_parent" , "1.0.0" do |s |
1208+ s . add_dependency "fallback_dep"
1209+ end
1210+ end
1211+
1212+ gemfile <<-G
1213+ source "https://gem.repo2"
1214+
1215+ gem "foo"
1216+
1217+ source "https://gem.repo3" do
1218+ gem "private_parent", "1.0.0"
1219+ end
1220+ G
1221+
1222+ bundle :install , artifice : "compact_index"
1223+ end
1224+
1225+ it "falls back to the default rubygems source for that dependency" do
1226+ build_repo2 do
1227+ build_gem "foo" , "2.0.0"
1228+ end
1229+
1230+ system_gems [ ]
1231+
1232+ bundle "update foo" , artifice : "compact_index"
1233+
1234+ expect ( the_bundle ) . to include_gems ( "private_parent 1.0.0" , "fallback_dep 1.0.0" , "foo 2.0.0" )
1235+ expect ( the_bundle ) . to include_gems ( "private_parent 1.0.0" , source : "remote3" )
1236+ expect ( the_bundle ) . to include_gems ( "fallback_dep 1.0.0" , source : "remote2" )
1237+ end
1238+ end
11981239end
You can’t perform that action at this time.
0 commit comments