Skip to content

Commit e6483d9

Browse files
hsbtmatzbot
authored andcommitted
[ruby/rubygems] Added failing example
ruby/rubygems@73735b503c
1 parent 779c3f9 commit e6483d9

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

spec/bundler/install/gemfile/sources_spec.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,4 +1236,41 @@
12361236
expect(the_bundle).to include_gems("fallback_dep 1.0.0", source: "remote2")
12371237
end
12381238
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
12391276
end

0 commit comments

Comments
 (0)