summaryrefslogtreecommitdiff
path: root/spec/bundler/install
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-01-19 13:28:23 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-01-19 15:01:44 +0900
commitd22511fd7595ef1819baa42851d598d95b8f4d00 (patch)
tree83e823c033f5c39c314cf4379f0bac5c43adf3d4 /spec/bundler/install
parent5646f4b67b75e7e558c994ff8cbd374e4b4bd3b5 (diff)
Merge rubygems/rubygems HEAD.
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5462
Diffstat (limited to 'spec/bundler/install')
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb2
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb11
-rw-r--r--spec/bundler/install/gems/resolving_spec.rb35
3 files changed, 31 insertions, 17 deletions
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index 6d9cd2daff..e7cf8f08d2 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -179,7 +179,7 @@ RSpec.describe "bundle install from an existing gemspec" do
gemspec :path => '#{tmp.join("foo")}'
G
- bundle "update --bundler", :verbose => true
+ bundle "update --bundler", :artifice => "compact_index", :verbose => true
expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 JAVA"
end
diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb
index 9738a75474..79317a7fad 100644
--- a/spec/bundler/install/gems/dependency_api_spec.rb
+++ b/spec/bundler/install/gems/dependency_api_spec.rb
@@ -402,17 +402,6 @@ RSpec.describe "gemcutter's dependency API" do
expect(the_bundle).to include_gems "back_deps 1.0"
end
- it "uses the endpoint if all sources support it" do
- gemfile <<-G
- source "#{source_uri}"
-
- gem 'foo'
- G
-
- bundle :install, :artifice => "endpoint_api_missing"
- expect(the_bundle).to include_gems "foo 1.0"
- end
-
it "fetches again when more dependencies are found in subsequent sources using deployment mode", :bundler => "< 3" do
build_repo2 do
build_gem "back_deps" do |s|
diff --git a/spec/bundler/install/gems/resolving_spec.rb b/spec/bundler/install/gems/resolving_spec.rb
index 4cf57f439e..b0209489b9 100644
--- a/spec/bundler/install/gems/resolving_spec.rb
+++ b/spec/bundler/install/gems/resolving_spec.rb
@@ -224,6 +224,27 @@ RSpec.describe "bundle install with install-time dependencies" do
expect(the_bundle).to include_gems("rack 1.2")
end
+ it "installs the older version when using servers not implementing the compact index API" do
+ build_repo2 do
+ build_gem "rack", "1.2" do |s|
+ s.executables = "rackup"
+ end
+
+ build_gem "rack", "9001.0.0" do |s|
+ s.required_ruby_version = "> 9000"
+ end
+ end
+
+ install_gemfile <<-G, :artifice => "endpoint", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
+ ruby "#{RUBY_VERSION}"
+ source "http://localgemserver.test/"
+ gem 'rack'
+ G
+
+ expect(out).to_not include("rack-9001.0.0 requires ruby version > 9000")
+ expect(the_bundle).to include_gems("rack 1.2")
+ end
+
it "installs the older version under rate limiting conditions" do
build_repo4 do
build_gem "rack", "9001.0.0" do |s|
@@ -284,8 +305,6 @@ RSpec.describe "bundle install with install-time dependencies" do
shared_examples_for "ruby version conflicts" do
it "raises an error during resolution" do
- skip "ruby requirement includes platform and it shouldn't" if Gem.win_platform?
-
install_gemfile <<-G, :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }, :raise_on_error => false
source "http://localgemserver.test/"
ruby #{ruby_requirement}
@@ -301,8 +320,6 @@ RSpec.describe "bundle install with install-time dependencies" do
require_ruby was resolved to 1.0, which depends on
Ruby\0 (> 9000)
-
- Ruby\0 (> 9000), which is required by gem 'require_ruby', is not available in the local ruby installation
E
expect(err).to end_with(nice_error)
end
@@ -341,7 +358,15 @@ RSpec.describe "bundle install with install-time dependencies" do
G
expect(err).to_not include("Gem::InstallError: require_rubygems requires RubyGems version > 9000")
- expect(err).to include("require_rubygems-1.0 requires rubygems version > 9000, which is incompatible with the current version, #{Gem::VERSION}")
+ nice_error = strip_whitespace(<<-E).strip
+ Bundler found conflicting requirements for the RubyGems\0 version:
+ In Gemfile:
+ RubyGems\0 (= #{Gem::VERSION})
+
+ require_rubygems was resolved to 1.0, which depends on
+ RubyGems\0 (> 9000)
+ E
+ expect(err).to end_with(nice_error)
end
end
end