diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2024-01-05 19:47:32 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2024-01-11 13:51:52 +0900 |
commit | ef0705b3c2339055d9b5c669fb6192275c39020a (patch) | |
tree | 63904928ce9defd4b47ef98942e06edbc148b16e /spec/bundler/commands | |
parent | b8f859f0bf21d67d962d12a99e1f2d7d2f20e3e5 (diff) |
[rubygems/rubygems] Fix development dependency not being added if introduced by two gemspecs
https://github.com/rubygems/rubygems/commit/adc05bf1c3
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r-- | spec/bundler/commands/install_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 7c016ff3d8..f0c9aaea8e 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -460,6 +460,35 @@ RSpec.describe "bundle install with gem sources" do expect(the_bundle).to include_gems("rubocop 1.37.1") end + it "includes the gem without warning if two gemspecs add it with the same requirement" do + gem1 = tmp.join("my-gem-1") + gem2 = tmp.join("my-gem-2") + + build_lib "my-gem", path: gem1 do |s| + s.add_development_dependency "rubocop", "~> 1.36.0" + end + + build_lib "my-gem-2", path: gem2 do |s| + s.add_development_dependency "rubocop", "~> 1.36.0" + end + + build_repo4 do + build_gem "rubocop", "1.36.0" + end + + gemfile <<~G + source "#{file_uri_for(gem_repo4)}" + + gemspec path: "#{gem1}" + gemspec path: "#{gem2}" + G + + bundle :install + + expect(err).to be_empty + expect(the_bundle).to include_gems("rubocop 1.36.0") + end + it "warns when a Gemfile dependency is overriding a gemspec development dependency, with different requirements" do build_lib "my-gem", path: bundled_app do |s| s.add_development_dependency "rails", ">= 5" |