summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile/specific_platform_spec.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-12-15 12:41:28 +0100
committergit <svn-admin@ruby-lang.org>2021-12-17 16:35:20 +0900
commit1537471871f9a06624689b55be222f0ea601d140 (patch)
tree1911ddbe1f9ade08f1f5e13f64b92f565afda033 /spec/bundler/install/gemfile/specific_platform_spec.rb
parentf3b50507c777522ec5d3e7662c8818df29e29f62 (diff)
[rubygems/rubygems] Share gem not found logic with transitive dependencies too
https://github.com/rubygems/rubygems/commit/e4a1a9663d
Diffstat (limited to 'spec/bundler/install/gemfile/specific_platform_spec.rb')
-rw-r--r--spec/bundler/install/gemfile/specific_platform_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/bundler/install/gemfile/specific_platform_spec.rb b/spec/bundler/install/gemfile/specific_platform_spec.rb
index 3acc29041e..6035f55ef2 100644
--- a/spec/bundler/install/gemfile/specific_platform_spec.rb
+++ b/spec/bundler/install/gemfile/specific_platform_spec.rb
@@ -302,6 +302,27 @@ RSpec.describe "bundle install with specific platforms" do
expect(err).to include("The source contains the following gems matching 'sorbet-static (= 0.5.6433)': sorbet-static-0.5.6433-universal-darwin-20, sorbet-static-0.5.6433-x86_64-linux")
end
+ it "does not resolve if the current platform does not match any of available platform specific variants for a transitive dependency" do
+ build_repo2 do
+ build_gem("sorbet", "0.5.6433") {|s| s.add_dependency "sorbet-static", "= 0.5.6433" }
+ build_gem("sorbet-static", "0.5.6433") {|s| s.platform = "x86_64-linux" }
+ build_gem("sorbet-static", "0.5.6433") {|s| s.platform = "universal-darwin-20" }
+ end
+
+ gemfile <<~G
+ source "#{file_uri_for(gem_repo2)}"
+
+ gem "sorbet", "0.5.6433"
+ G
+
+ simulate_platform "arm64-darwin-21" do
+ bundle "install", :raise_on_error => false
+ end
+
+ expect(err).to include("Could not find gem 'sorbet-static (= 0.5.6433) arm64-darwin-21', which is required by gem 'sorbet (= 0.5.6433)', in rubygems repository #{file_uri_for(gem_repo2)}/ or installed locally.")
+ expect(err).to include("The source contains the following gems matching 'sorbet-static (= 0.5.6433)': sorbet-static-0.5.6433-universal-darwin-20, sorbet-static-0.5.6433-x86_64-linux")
+ end
+
private
def setup_multiplatform_gem