summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2026-02-03 21:03:25 +0900
committergit <svn-admin@ruby-lang.org>2026-02-04 06:02:23 +0000
commite6483d98907654d015ececd5de6a0079084f8f33 (patch)
tree2cae9adf30cbbaec1a663ac888f0048a7397f36f /spec
parent779c3f928acd6d827b1d753ccb9e85c9e11e62bf (diff)
[ruby/rubygems] Added failing example
https://github.com/ruby/rubygems/commit/73735b503c
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index 69b0816a18..4957ef70be 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -1236,4 +1236,41 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("fallback_dep 1.0.0", source: "remote2")
end
end
+
+ context "when a path gem has a transitive dependency that does not exist in the path source" do
+ before do
+ build_repo2 do
+ build_gem "missing_dep", "1.0.0"
+ build_gem "foo", "1.0.0"
+ end
+
+ build_lib "parent_gem", "1.0.0", path: lib_path("parent_gem") do |s|
+ s.add_dependency "missing_dep"
+ end
+
+ gemfile <<-G
+ source "https://gem.repo2"
+
+ gem "foo"
+
+ gem "parent_gem", path: "#{lib_path("parent_gem")}"
+ G
+
+ bundle :install, artifice: "compact_index"
+ end
+
+ it "falls back to the default rubygems source for that dependency when updating" do
+ build_repo2 do
+ build_gem "foo", "2.0.0"
+ end
+
+ system_gems []
+
+ bundle "update foo", artifice: "compact_index"
+
+ expect(the_bundle).to include_gems("parent_gem 1.0.0", "missing_dep 1.0.0", "foo 2.0.0")
+ expect(the_bundle).to include_gems("parent_gem 1.0.0", source: "path@#{lib_path("parent_gem")}")
+ expect(the_bundle).to include_gems("missing_dep 1.0.0", source: "remote2")
+ end
+ end
end