|
1236 | 1236 | expect(the_bundle).to include_gems("fallback_dep 1.0.0", source: "remote2") |
1237 | 1237 | end |
1238 | 1238 | end |
| 1239 | + |
| 1240 | + context "when a path gem has a transitive dependency that does not exist in the path source" do |
| 1241 | + before do |
| 1242 | + build_repo2 do |
| 1243 | + build_gem "missing_dep", "1.0.0" |
| 1244 | + build_gem "foo", "1.0.0" |
| 1245 | + end |
| 1246 | + |
| 1247 | + build_lib "parent_gem", "1.0.0", path: lib_path("parent_gem") do |s| |
| 1248 | + s.add_dependency "missing_dep" |
| 1249 | + end |
| 1250 | + |
| 1251 | + gemfile <<-G |
| 1252 | + source "https://gem.repo2" |
| 1253 | +
|
| 1254 | + gem "foo" |
| 1255 | +
|
| 1256 | + gem "parent_gem", path: "#{lib_path("parent_gem")}" |
| 1257 | + G |
| 1258 | + |
| 1259 | + bundle :install, artifice: "compact_index" |
| 1260 | + end |
| 1261 | + |
| 1262 | + it "falls back to the default rubygems source for that dependency when updating" do |
| 1263 | + build_repo2 do |
| 1264 | + build_gem "foo", "2.0.0" |
| 1265 | + end |
| 1266 | + |
| 1267 | + system_gems [] |
| 1268 | + |
| 1269 | + bundle "update foo", artifice: "compact_index" |
| 1270 | + |
| 1271 | + expect(the_bundle).to include_gems("parent_gem 1.0.0", "missing_dep 1.0.0", "foo 2.0.0") |
| 1272 | + expect(the_bundle).to include_gems("parent_gem 1.0.0", source: "path@#{lib_path("parent_gem")}") |
| 1273 | + expect(the_bundle).to include_gems("missing_dep 1.0.0", source: "remote2") |
| 1274 | + end |
| 1275 | + end |
| 1276 | + |
| 1277 | + context "when a git gem has a transitive dependency that does not exist in the git source" do |
| 1278 | + before do |
| 1279 | + build_repo2 do |
| 1280 | + build_gem "missing_dep", "1.0.0" |
| 1281 | + build_gem "foo", "1.0.0" |
| 1282 | + end |
| 1283 | + |
| 1284 | + build_git "parent_gem", "1.0.0", path: lib_path("parent_gem") do |s| |
| 1285 | + s.add_dependency "missing_dep" |
| 1286 | + end |
| 1287 | + |
| 1288 | + gemfile <<-G |
| 1289 | + source "https://gem.repo2" |
| 1290 | +
|
| 1291 | + gem "foo" |
| 1292 | +
|
| 1293 | + gem "parent_gem", git: "#{lib_path("parent_gem")}" |
| 1294 | + G |
| 1295 | + |
| 1296 | + bundle :install, artifice: "compact_index" |
| 1297 | + end |
| 1298 | + |
| 1299 | + it "falls back to the default rubygems source for that dependency when updating" do |
| 1300 | + build_repo2 do |
| 1301 | + build_gem "foo", "2.0.0" |
| 1302 | + end |
| 1303 | + |
| 1304 | + system_gems [] |
| 1305 | + |
| 1306 | + bundle "update foo", artifice: "compact_index" |
| 1307 | + |
| 1308 | + expect(the_bundle).to include_gems("parent_gem 1.0.0", "missing_dep 1.0.0", "foo 2.0.0") |
| 1309 | + expect(the_bundle).to include_gems("parent_gem 1.0.0", source: "git@#{lib_path("parent_gem")}") |
| 1310 | + expect(the_bundle).to include_gems("missing_dep 1.0.0", source: "remote2") |
| 1311 | + end |
| 1312 | + end |
1239 | 1313 | end |
0 commit comments