diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-05-31 09:49:50 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-06-01 00:14:31 +0900 |
commit | fd83b8887f78b6e7746a3986a2e075663341d17e (patch) | |
tree | a6c0dfc410d519c94fe5160c7c1bbb66b2652c79 /spec/bundler | |
parent | e2b421d679d7ebd2c7d6b44a96c8353b81e447b9 (diff) | |
download | ruby-fd83b8887f78b6e7746a3986a2e075663341d17e.tar.gz |
[rubygems/rubygems] Skip duplicated dependency warning for gemspec dev deps
Generally this warning is skipped for gemspec development dependencies.
I think because it's common to override them in the Gemfile to change
the source, for example.
But the order of conditions was not correct and the warning was still
being printed in one case.
https://github.com/rubygems/rubygems/commit/da9d1d6a3f
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/install/gemfile/sources_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb index 62cad6800f..89c812e5d5 100644 --- a/spec/bundler/install/gemfile/sources_spec.rb +++ b/spec/bundler/install/gemfile/sources_spec.rb @@ -1255,6 +1255,32 @@ RSpec.describe "bundle install with gems on multiple sources" do end end + context "when Gemfile overrides a gemspec development dependency to change the default source" do + before do + build_repo4 do + build_gem "bar" + end + + build_lib("gemspec_test", :path => tmp.join("gemspec_test")) do |s| + s.add_development_dependency "bar" + end + + install_gemfile <<-G, :artifice => "compact_index" + source "https://gem.repo1" + + source "https://gem.repo4" do + gem "bar" + end + + gemspec :path => "#{tmp.join("gemspec_test")}" + G + end + + it "does not print warnings" do + expect(err).to be_empty + end + end + it "doesn't update version when a gem uses a source block but a higher version from another source is already installed locally" do build_repo2 do build_gem "example", "0.1.0" |