summaryrefslogtreecommitdiff
path: root/spec/bundler/install
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/install')
-rw-r--r--spec/bundler/install/gemfile/eval_gemfile_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb84
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb30
-rw-r--r--spec/bundler/install/gemfile/sources_spec.rb12
-rw-r--r--spec/bundler/install/gemfile/specific_platform_spec.rb6
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb15
-rw-r--r--spec/bundler/install/gems/flex_spec.rb2
-rw-r--r--spec/bundler/install/gems/resolving_spec.rb4
-rw-r--r--spec/bundler/install/yanked_spec.rb6
9 files changed, 88 insertions, 73 deletions
diff --git a/spec/bundler/install/gemfile/eval_gemfile_spec.rb b/spec/bundler/install/gemfile/eval_gemfile_spec.rb
index cfa66e5986..7d2f9d46f9 100644
--- a/spec/bundler/install/gemfile/eval_gemfile_spec.rb
+++ b/spec/bundler/install/gemfile/eval_gemfile_spec.rb
@@ -2,7 +2,7 @@
RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
before do
- build_lib("gunks", path: bundled_app.join("gems/gunks")) do |s|
+ build_lib("gunks", path: bundled_app("gems/gunks")) do |s|
s.name = "gunks"
s.version = "0.0.1"
end
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index 63778567cf..2932228a54 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -39,14 +39,14 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "should install runtime and development dependencies" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("Gemfile", "source :rubygems\ngemspec")
s.add_dependency "bar", "=1.0.0"
s.add_development_dependency "bar-dev", "=1.0.0"
end
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
expect(the_bundle).to include_gems "bar 1.0.0"
@@ -54,16 +54,16 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "that is hidden should install runtime and development dependencies" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("Gemfile", "source :rubygems\ngemspec")
s.add_dependency "bar", "=1.0.0"
s.add_development_dependency "bar-dev", "=1.0.0"
end
- FileUtils.mv tmp.join("foo", "foo.gemspec"), tmp.join("foo", ".gemspec")
+ FileUtils.mv tmp("foo", "foo.gemspec"), tmp("foo", ".gemspec")
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
expect(the_bundle).to include_gems "bar 1.0.0"
@@ -76,42 +76,42 @@ RSpec.describe "bundle install from an existing gemspec" do
build_gem "baz", "1.1"
end
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("Gemfile", "source :rubygems\ngemspec")
s.add_dependency "baz", ">= 1.0", "< 1.1"
end
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
expect(the_bundle).to include_gems "baz 1.0"
end
it "should raise if there are no gemspecs available" do
- build_lib("foo", path: tmp.join("foo"), gemspec: false)
+ build_lib("foo", path: tmp("foo"), gemspec: false)
install_gemfile <<-G, raise_on_error: false
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
- expect(err).to match(/There are no gemspecs at #{tmp.join("foo")}/)
+ expect(err).to match(/There are no gemspecs at #{tmp("foo")}/)
end
it "should raise if there are too many gemspecs available" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("foo2.gemspec", build_spec("foo", "4.0").first.to_ruby)
end
install_gemfile <<-G, raise_on_error: false
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
- expect(err).to match(/There are multiple gemspecs at #{tmp.join("foo")}/)
+ expect(err).to match(/There are multiple gemspecs at #{tmp("foo")}/)
end
it "should pick a specific gemspec" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("foo2.gemspec", "")
s.add_dependency "bar", "=1.0.0"
s.add_development_dependency "bar-dev", "=1.0.0"
@@ -119,7 +119,7 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile(<<-G)
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
+ gemspec :path => '#{tmp("foo")}', :name => 'foo'
G
expect(the_bundle).to include_gems "bar 1.0.0"
@@ -127,7 +127,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "should use a specific group for development dependencies" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("foo2.gemspec", "")
s.add_dependency "bar", "=1.0.0"
s.add_development_dependency "bar-dev", "=1.0.0"
@@ -135,7 +135,7 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile(<<-G)
source "#{file_uri_for(gem_repo2)}"
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo', :development_group => :dev
+ gemspec :path => '#{tmp("foo")}', :name => 'foo', :development_group => :dev
G
expect(the_bundle).to include_gems "bar 1.0.0"
@@ -144,33 +144,33 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "should match a lockfile even if the gemspec defines development dependencies" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.write("Gemfile", "source '#{file_uri_for(gem_repo1)}'\ngemspec")
s.add_dependency "actionpack", "=2.3.2"
s.add_development_dependency "rake", rake_version
end
- bundle "install", dir: tmp.join("foo")
+ bundle "install", dir: tmp("foo")
# This should really be able to rely on $stderr, but, it's not written
# right, so we can't. In fact, this is a bug negation test, and so it'll
# ghost pass in future, and will only catch a regression if the message
# doesn't change. Exit codes should be used correctly (they can be more
# than just 0 and 1).
bundle "config set --local deployment true"
- output = bundle("install", dir: tmp.join("foo"))
+ output = bundle("install", dir: tmp("foo"))
expect(output).not_to match(/You have added to the Gemfile/)
expect(output).not_to match(/You have deleted from the Gemfile/)
expect(output).not_to match(/the lockfile can't be updated because frozen mode is set/)
end
it "should match a lockfile without needing to re-resolve" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.add_dependency "rack"
end
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
bundle "install", verbose: true
@@ -182,14 +182,14 @@ RSpec.describe "bundle install from an existing gemspec" do
it "should match a lockfile without needing to re-resolve with development dependencies" do
simulate_platform java
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.add_dependency "rack"
s.add_development_dependency "thin"
end
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
bundle "install", verbose: true
@@ -199,14 +199,14 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "should match a lockfile on non-ruby platforms with a transitive platform dependency", :jruby_only do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.add_dependency "platform_specific"
end
system_gems "platform_specific-1.0-java", path: default_bundle_path
install_gemfile <<-G
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
bundle "update --bundler", artifice: "compact_index", verbose: true
@@ -214,13 +214,13 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "should evaluate the gemspec in its directory" do
- build_lib("foo", path: tmp.join("foo"))
- File.open(tmp.join("foo/foo.gemspec"), "w") do |s|
- s.write "raise 'ahh' unless Dir.pwd == '#{tmp.join("foo")}'"
+ build_lib("foo", path: tmp("foo"))
+ File.open(tmp("foo/foo.gemspec"), "w") do |s|
+ s.write "raise 'ahh' unless Dir.pwd == '#{tmp("foo")}'"
end
install_gemfile <<-G, raise_on_error: false
- gemspec :path => '#{tmp.join("foo")}'
+ gemspec :path => '#{tmp("foo")}'
G
expect(last_command.stdboth).not_to include("ahh")
end
@@ -248,7 +248,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end
it "allows conflicts" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.version = "1.0.0"
s.add_dependency "bar", "= 1.0.0"
end
@@ -260,14 +260,14 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
gem "deps"
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
+ gemspec :path => '#{tmp("foo")}', :name => 'foo'
G
expect(the_bundle).to include_gems "foo 1.0.0"
end
it "does not break Gem.finish_resolve with conflicts" do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.version = "1.0.0"
s.add_dependency "bar", "= 1.0.0"
end
@@ -281,7 +281,7 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}"
gem "deps"
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
+ gemspec :path => '#{tmp("foo")}', :name => 'foo'
G
expect(the_bundle).to include_gems "foo 1.0.0"
@@ -359,7 +359,7 @@ RSpec.describe "bundle install from an existing gemspec" do
let(:source_uri) { "http://localgemserver.test" }
before do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.add_dependency "rack", "=1.0.0"
end
@@ -398,7 +398,7 @@ RSpec.describe "bundle install from an existing gemspec" do
context "using JRuby with explicit platform", :jruby_only do
before do
create_file(
- tmp.join("foo", "foo-java.gemspec"),
+ tmp("foo", "foo-java.gemspec"),
build_spec("foo", "1.0", "java") do
dep "rack", "=1.0.0"
@spec.authors = "authors"
@@ -589,7 +589,7 @@ RSpec.describe "bundle install from an existing gemspec" do
context "with multiple platforms" do
before do
- build_lib("foo", path: tmp.join("foo")) do |s|
+ build_lib("foo", path: tmp("foo")) do |s|
s.version = "1.0.0"
s.add_development_dependency "rack"
s.write "foo-universal-java.gemspec", build_spec("foo", "1.0.0", "universal-java") {|sj| sj.runtime "rack", "1.0.0" }.first.to_ruby
@@ -601,7 +601,7 @@ RSpec.describe "bundle install from an existing gemspec" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
+ gemspec :path => '#{tmp("foo")}', :name => 'foo'
G
expect(the_bundle).to include_gems "foo 1.0.0", "rack 1.0.0"
@@ -613,7 +613,7 @@ RSpec.describe "bundle install from an existing gemspec" do
bundle "config set --local without development"
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
- gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
+ gemspec :path => '#{tmp("foo")}', :name => 'foo'
G
expect(the_bundle).to include_gem "foo 1.0.0"
@@ -623,7 +623,7 @@ RSpec.describe "bundle install from an existing gemspec" do
context "with multiple platforms and resolving for more specific platforms" do
before do
- build_lib("chef", path: tmp.join("chef")) do |s|
+ build_lib("chef", path: tmp("chef")) do |s|
s.version = "17.1.17"
s.write "chef-universal-mingw32.gemspec", build_spec("chef", "17.1.17", "universal-mingw32") {|sw| sw.runtime "win32-api", "~> 1.5.3" }.first.to_ruby
end
@@ -682,7 +682,7 @@ RSpec.describe "bundle install from an existing gemspec" do
context "with multiple locked platforms" do
before do
- build_lib("activeadmin", path: tmp.join("activeadmin")) do |s|
+ build_lib("activeadmin", path: tmp("activeadmin")) do |s|
s.version = "2.9.0"
s.add_dependency "railties", ">= 5.2", "< 6.2"
end
@@ -735,7 +735,7 @@ RSpec.describe "bundle install from an existing gemspec" do
#{Bundler::VERSION}
L
- gemspec = tmp.join("activeadmin/activeadmin.gemspec")
+ gemspec = tmp("activeadmin/activeadmin.gemspec")
File.write(gemspec, File.read(gemspec).sub(">= 5.2", ">= 6.0"))
previous_lockfile = lockfile
diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb
index 45ee7b44d1..21216594b1 100644
--- a/spec/bundler/install/gemfile/git_spec.rb
+++ b/spec/bundler/install/gemfile/git_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe "bundle install with git sources" do
end
it "does not write to cache on bundler/setup" do
- cache_path = default_bundle_path.join("cache")
+ cache_path = default_bundle_path("cache")
FileUtils.rm_rf(cache_path)
ruby "require 'bundler/setup'"
expect(cache_path).not_to exist
@@ -59,7 +59,7 @@ RSpec.describe "bundle install with git sources" do
bundle "update foo"
sha = git.ref_for("main", 11)
- spec_file = default_bundle_path.join("bundler/gems/foo-1.0-#{sha}/foo.gemspec")
+ spec_file = default_bundle_path("bundler/gems/foo-1.0-#{sha}/foo.gemspec")
expect(spec_file).to exist
ruby_code = Gem::Specification.load(spec_file.to_s).to_ruby
file_code = File.read(spec_file)
@@ -272,7 +272,7 @@ RSpec.describe "bundle install with git sources" do
s.write("lib/foo.rb", "raise 'FAIL'")
end
- sys_exec("git update-ref -m \"Bundler Spec!\" refs/bundler/1 main~1", dir: lib_path("foo-1.0"))
+ git("update-ref -m \"Bundler Spec!\" refs/bundler/1 main~1", lib_path("foo-1.0"))
# want to ensure we don't fallback to HEAD
update_git "foo", path: lib_path("foo-1.0"), branch: "rando" do |s|
@@ -308,7 +308,7 @@ RSpec.describe "bundle install with git sources" do
s.write("lib/foo.rb", "raise 'FAIL'")
end
- sys_exec("git update-ref -m \"Bundler Spec!\" refs/bundler/1 main~1", dir: lib_path("foo-1.0"))
+ git("update-ref -m \"Bundler Spec!\" refs/bundler/1 main~1", lib_path("foo-1.0"))
# want to ensure we don't fallback to HEAD
update_git "foo", path: lib_path("foo-1.0"), branch: "rando" do |s|
@@ -332,7 +332,7 @@ RSpec.describe "bundle install with git sources" do
end
it "does not download random non-head refs" do
- sys_exec("git update-ref -m \"Bundler Spec!\" refs/bundler/1 main~1", dir: lib_path("foo-1.0"))
+ git("update-ref -m \"Bundler Spec!\" refs/bundler/1 main~1", lib_path("foo-1.0"))
bundle "config set global_gem_cache true"
@@ -346,7 +346,7 @@ RSpec.describe "bundle install with git sources" do
# ensure we also git fetch after cloning
bundle :update, all: true
- sys_exec("git ls-remote .", dir: Dir[home(".bundle/cache/git/foo-*")].first)
+ git("ls-remote .", Dir[home(".bundle/cache/git/foo-*")].first)
expect(out).not_to include("refs/bundler/1")
end
@@ -906,7 +906,7 @@ RSpec.describe "bundle install with git sources" do
bundle "update", all: true
expect(the_bundle).to include_gems "forced 1.1"
- sys_exec("git reset --hard HEAD^", dir: lib_path("forced-1.0"))
+ git("reset --hard HEAD^", lib_path("forced-1.0"))
bundle "update", all: true
expect(the_bundle).to include_gems "forced 1.0"
@@ -920,8 +920,8 @@ RSpec.describe "bundle install with git sources" do
build_git "has_submodule", "1.0" do |s|
s.add_dependency "submodule"
end
- sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", dir: lib_path("has_submodule-1.0")
- sys_exec "git commit -m \"submodulator\"", dir: lib_path("has_submodule-1.0")
+ git "submodule add #{lib_path("submodule-1.0")} submodule-1.0", lib_path("has_submodule-1.0")
+ git "commit -m \"submodulator\"", lib_path("has_submodule-1.0")
install_gemfile <<-G, raise_on_error: false
source "#{file_uri_for(gem_repo1)}"
@@ -929,7 +929,7 @@ RSpec.describe "bundle install with git sources" do
gem "has_submodule"
end
G
- expect(err).to match(%r{submodule >= 0 could not be found in rubygems repository #{file_uri_for(gem_repo1)}/, cached gems or installed locally})
+ expect(err).to match(%r{submodule >= 0 could not be found in rubygems repository #{file_uri_for(gem_repo1)}/ or installed locally})
expect(the_bundle).not_to include_gems "has_submodule 1.0"
end
@@ -942,8 +942,8 @@ RSpec.describe "bundle install with git sources" do
build_git "has_submodule", "1.0" do |s|
s.add_dependency "submodule"
end
- sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", dir: lib_path("has_submodule-1.0")
- sys_exec "git commit -m \"submodulator\"", dir: lib_path("has_submodule-1.0")
+ git "submodule add #{lib_path("submodule-1.0")} submodule-1.0", lib_path("has_submodule-1.0")
+ git "commit -m \"submodulator\"", lib_path("has_submodule-1.0")
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
@@ -962,8 +962,8 @@ RSpec.describe "bundle install with git sources" do
build_git "submodule", "1.0"
build_git "has_submodule", "1.0"
- sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", dir: lib_path("has_submodule-1.0")
- sys_exec "git commit -m \"submodulator\"", dir: lib_path("has_submodule-1.0")
+ git "submodule add #{lib_path("submodule-1.0")} submodule-1.0", lib_path("has_submodule-1.0")
+ git "commit -m \"submodulator\"", lib_path("has_submodule-1.0")
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
@@ -1292,7 +1292,7 @@ RSpec.describe "bundle install with git sources" do
void Init_foo() { rb_define_global_function("foo", &foo, 0); }
C
end
- sys_exec("git commit -m \"commit for iteration #{i}\" ext/foo.c", dir: git_reader.path)
+ git("commit -m \"commit for iteration #{i}\" ext/foo.c", git_reader.path)
git_commit_sha = git_reader.ref_for("HEAD")
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb
index a5ba76f4d9..3de77ff7e3 100644
--- a/spec/bundler/install/gemfile/sources_spec.rb
+++ b/spec/bundler/install/gemfile/sources_spec.rb
@@ -520,7 +520,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "fails" do
bundle :install, artifice: "compact_index", raise_on_error: false
- expect(err).to include("Could not find gem 'private_gem_1' in rubygems repository https://gem.repo2/, cached gems or installed locally.")
+ expect(err).to include("Could not find gem 'private_gem_1' in rubygems repository https://gem.repo2/ or installed locally.")
end
end
@@ -611,7 +611,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
Could not find compatible versions
Because every version of depends_on_rack depends on rack >= 0
- and rack >= 0 could not be found in rubygems repository https://gem.repo2/, cached gems or installed locally,
+ and rack >= 0 could not be found in rubygems repository https://gem.repo2/ or installed locally,
depends_on_rack cannot be used.
So, because Gemfile depends on depends_on_rack >= 0,
version solving has failed.
@@ -1484,14 +1484,14 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "bar"
end
- build_lib("gemspec_test", path: tmp.join("gemspec_test")) do |s|
+ build_lib("gemspec_test", path: tmp("gemspec_test")) do |s|
s.add_dependency "bar", "=1.0.0"
end
install_gemfile <<-G, artifice: "compact_index"
source "https://gem.repo2"
gem "rack"
- gemspec :path => "#{tmp.join("gemspec_test")}"
+ gemspec :path => "#{tmp("gemspec_test")}"
G
end
@@ -1506,7 +1506,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
build_gem "bar"
end
- build_lib("gemspec_test", path: tmp.join("gemspec_test")) do |s|
+ build_lib("gemspec_test", path: tmp("gemspec_test")) do |s|
s.add_development_dependency "bar"
end
@@ -1517,7 +1517,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "bar"
end
- gemspec :path => "#{tmp.join("gemspec_test")}"
+ gemspec :path => "#{tmp("gemspec_test")}"
G
end
diff --git a/spec/bundler/install/gemfile/specific_platform_spec.rb b/spec/bundler/install/gemfile/specific_platform_spec.rb
index 5f1b034bfc..1a33053dc6 100644
--- a/spec/bundler/install/gemfile/specific_platform_spec.rb
+++ b/spec/bundler/install/gemfile/specific_platform_spec.rb
@@ -395,7 +395,7 @@ RSpec.describe "bundle install with specific platforms" do
G
error_message = <<~ERROR.strip
- Could not find gem 'sorbet-static (= 0.5.6433)' with platform 'arm64-darwin-21' in rubygems repository #{file_uri_for(gem_repo4)}/, cached gems or installed locally.
+ Could not find gem 'sorbet-static (= 0.5.6433)' with platform 'arm64-darwin-21' in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally.
The source contains the following gems matching 'sorbet-static (= 0.5.6433)':
* sorbet-static-0.5.6433-universal-darwin-20
@@ -434,7 +434,7 @@ RSpec.describe "bundle install with specific platforms" do
Could not find compatible versions
Because every version of sorbet depends on sorbet-static = 0.5.6433
- and sorbet-static = 0.5.6433 could not be found in rubygems repository #{file_uri_for(gem_repo4)}/, cached gems or installed locally for any resolution platforms (arm64-darwin-21),
+ and sorbet-static = 0.5.6433 could not be found in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally for any resolution platforms (arm64-darwin-21),
sorbet cannot be used.
So, because Gemfile depends on sorbet = 0.5.6433,
version solving has failed.
@@ -473,7 +473,7 @@ RSpec.describe "bundle install with specific platforms" do
bundle "lock", raise_on_error: false, env: { "BUNDLE_FORCE_RUBY_PLATFORM" => "true" }
expect(err).to include <<~ERROR.rstrip
- Could not find gem 'sorbet-static (= 0.5.9889)' with platform 'ruby' in rubygems repository #{file_uri_for(gem_repo4)}/, cached gems or installed locally.
+ Could not find gem 'sorbet-static (= 0.5.9889)' with platform 'ruby' in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally.
The source contains the following gems matching 'sorbet-static (= 0.5.9889)':
* sorbet-static-0.5.9889-#{Gem::Platform.local}
diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb
index 50add8743b..bd741685d9 100644
--- a/spec/bundler/install/gems/compact_index_spec.rb
+++ b/spec/bundler/install/gems/compact_index_spec.rb
@@ -15,6 +15,21 @@ RSpec.describe "compact index api" do
expect(the_bundle).to include_gems "rack 1.0.0"
end
+ it "has a debug mode" do
+ gemfile <<-G
+ source "#{source_uri}"
+ gem "rack"
+ G
+
+ bundle :install, artifice: "compact_index", env: { "DEBUG_COMPACT_INDEX" => "true" }
+ expect(out).to include("Fetching gem metadata from #{source_uri}")
+ expect(err).to include("[Bundler::CompactIndexClient] available?")
+ expect(err).to include("[Bundler::CompactIndexClient] fetching versions")
+ expect(err).to include("[Bundler::CompactIndexClient] info(rack)")
+ expect(err).to include("[Bundler::CompactIndexClient] fetching info/rack")
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
+
it "should URI encode gem names" do
gemfile <<-G
source "#{source_uri}"
diff --git a/spec/bundler/install/gems/flex_spec.rb b/spec/bundler/install/gems/flex_spec.rb
index 8ef3984975..5e0c88fc95 100644
--- a/spec/bundler/install/gems/flex_spec.rb
+++ b/spec/bundler/install/gems/flex_spec.rb
@@ -197,7 +197,7 @@ RSpec.describe "bundle flex_install" do
Could not find compatible versions
Because rack-obama >= 2.0 depends on rack = 1.2
- and rack = 1.2 could not be found in rubygems repository #{file_uri_for(gem_repo2)}/, cached gems or installed locally,
+ and rack = 1.2 could not be found in rubygems repository #{file_uri_for(gem_repo2)}/ or installed locally,
rack-obama >= 2.0 cannot be used.
So, because Gemfile depends on rack-obama = 2.0,
version solving has failed.
diff --git a/spec/bundler/install/gems/resolving_spec.rb b/spec/bundler/install/gems/resolving_spec.rb
index c5f9c4a3d3..b54674898d 100644
--- a/spec/bundler/install/gems/resolving_spec.rb
+++ b/spec/bundler/install/gems/resolving_spec.rb
@@ -434,7 +434,7 @@ RSpec.describe "bundle install with install-time dependencies" do
end
nice_error = <<~E.strip
- Could not find gems matching 'sorbet-static (= 0.5.10554)' valid for all resolution platforms (arm64-darwin-21, aarch64-linux) in rubygems repository #{file_uri_for(gem_repo4)}/, cached gems or installed locally.
+ Could not find gems matching 'sorbet-static (= 0.5.10554)' valid for all resolution platforms (arm64-darwin-21, aarch64-linux) in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally.
The source contains the following gems matching 'sorbet-static (= 0.5.10554)':
* sorbet-static-0.5.10554-universal-darwin-21
@@ -490,7 +490,7 @@ RSpec.describe "bundle install with install-time dependencies" do
it "raises a proper error" do
nice_error = <<~E.strip
- Could not find gems matching 'sorbet-static' valid for all resolution platforms (arm-linux, x86_64-linux) in rubygems repository #{file_uri_for(gem_repo4)}/, cached gems or installed locally.
+ Could not find gems matching 'sorbet-static' valid for all resolution platforms (arm-linux, x86_64-linux) in rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally.
The source contains the following gems matching 'sorbet-static':
* sorbet-static-0.5.10696-x86_64-linux
diff --git a/spec/bundler/install/yanked_spec.rb b/spec/bundler/install/yanked_spec.rb
index 7408c24327..5aeabd2f23 100644
--- a/spec/bundler/install/yanked_spec.rb
+++ b/spec/bundler/install/yanked_spec.rb
@@ -188,7 +188,7 @@ RSpec.context "when using gem before installing" do
bundle :list, raise_on_error: false
- expect(err).to include("Could not find rack-0.9.1 in cached gems or installed locally")
+ expect(err).to include("Could not find rack-0.9.1 in locally installed gems")
expect(err).to_not include("Your bundle is locked to rack (0.9.1) from")
expect(err).to_not include("If you haven't changed sources, that means the author of rack (0.9.1) has removed it.")
expect(err).to_not include("You'll need to update your bundle to a different version of rack (0.9.1) that hasn't been removed in order to install.")
@@ -197,7 +197,7 @@ RSpec.context "when using gem before installing" do
lockfile lockfile.gsub(/PLATFORMS\n #{lockfile_platforms}/m, "PLATFORMS\n #{lockfile_platforms("ruby")}")
bundle :list, raise_on_error: false
- expect(err).to include("Could not find rack-0.9.1 in cached gems or installed locally")
+ expect(err).to include("Could not find rack-0.9.1 in locally installed gems")
end
it "does not suggest the author has yanked the gem when using more than one gem, but shows all gems that couldn't be found in the source" do
@@ -224,7 +224,7 @@ RSpec.context "when using gem before installing" do
bundle :list, raise_on_error: false
- expect(err).to include("Could not find rack-0.9.1, rack_middleware-1.0 in cached gems or installed locally")
+ expect(err).to include("Could not find rack-0.9.1, rack_middleware-1.0 in locally installed gems")
expect(err).to include("Install missing gems with `bundle install`.")
expect(err).to_not include("Your bundle is locked to rack (0.9.1) from")
expect(err).to_not include("If you haven't changed sources, that means the author of rack (0.9.1) has removed it.")