summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb6
-rw-r--r--lib/bundler/feature_flag.rb3
-rw-r--r--lib/bundler/lockfile_parser.rb4
-rw-r--r--lib/bundler/plugin/installer.rb2
-rw-r--r--lib/bundler/resolver.rb2
-rw-r--r--lib/bundler/settings.rb1
-rw-r--r--lib/bundler/source/rubygems.rb2
-rw-r--r--lib/bundler/source_list.rb13
-rw-r--r--spec/bundler/source_list_spec.rb4
-rw-r--r--spec/commands/exec_spec.rb19
-rw-r--r--spec/commands/list_spec.rb73
-rw-r--r--spec/install/gemfile/sources_spec.rb89
-rw-r--r--spec/install/gems/flex_spec.rb6
-rw-r--r--spec/install/post_bundle_message_spec.rb6
-rw-r--r--spec/lock/lockfile_spec.rb4
-rw-r--r--spec/other/major_deprecation_spec.rb24
-rw-r--r--spec/quality_spec.rb1
17 files changed, 183 insertions, 76 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index aa399c3983..f9daae067c 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -643,7 +643,7 @@ module Bundler
end
def converge_rubygems_sources
- return false if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ return false if Bundler.feature_flag.disable_multisource?
changes = false
@@ -915,7 +915,7 @@ module Bundler
# look for that gemspec (or its dependencies)
default = sources.default_source
source_requirements = { :default => default }
- default = nil unless Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ default = nil unless Bundler.feature_flag.disable_multisource?
dependencies.each do |dep|
next unless source = dep.source || default
source_requirements[dep.name] = source
@@ -929,7 +929,7 @@ module Bundler
def pinned_spec_names(skip = nil)
pinned_names = []
- default = Bundler.feature_flag.lockfile_uses_separate_rubygems_sources? && sources.default_source
+ default = Bundler.feature_flag.disable_multisource? && sources.default_source
@dependencies.each do |dep|
next unless dep_source = dep.source || default
next if dep_source == skip
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 04d8272195..bceaa7d86f 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -35,13 +35,12 @@ module Bundler
settings_flag(:cache_command_is_package) { bundler_2_mode? }
settings_flag(:default_install_uses_path) { bundler_2_mode? }
settings_flag(:deployment_means_frozen) { bundler_2_mode? }
- settings_flag(:disable_multisource) { bundler_2_mode? }
+ settings_flag(:disable_multisource) { bundler_3_mode? }
settings_flag(:error_on_stderr) { bundler_2_mode? }
settings_flag(:forget_cli_options) { bundler_3_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_2_mode? }
settings_flag(:global_gem_cache) { bundler_2_mode? }
settings_flag(:init_gems_rb) { bundler_2_mode? }
- settings_flag(:lockfile_uses_separate_rubygems_sources) { bundler_2_mode? }
settings_flag(:only_update_to_newer_versions) { bundler_2_mode? }
settings_flag(:path_relative_to_cwd) { bundler_2_mode? }
settings_flag(:plugins) { @bundler_version >= Gem::Version.new("1.14") }
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 19084f12b9..50dc1381fe 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -88,7 +88,7 @@ module Bundler
send("parse_#{@state}", line)
end
end
- @sources << @rubygems_aggregate unless Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ @sources << @rubygems_aggregate unless Bundler.feature_flag.disable_multisource?
@specs = @specs.values.sort_by(&:identifier)
warn_for_outdated_bundler_version
rescue ArgumentError => e
@@ -139,7 +139,7 @@ module Bundler
@sources << @current_source
end
when GEM
- if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ if Bundler.feature_flag.disable_multisource?
@opts["remotes"] = @opts.delete("remote")
@current_source = TYPES[@type].from_lock(@opts)
@sources << @current_source
diff --git a/lib/bundler/plugin/installer.rb b/lib/bundler/plugin/installer.rb
index a2ec0c1d65..4a262efac2 100644
--- a/lib/bundler/plugin/installer.rb
+++ b/lib/bundler/plugin/installer.rb
@@ -16,7 +16,7 @@ module Bundler
version = options[:version] || [">= 0"]
- Bundler.settings.temporary(:lockfile_uses_separate_rubygems_sources => false, :disable_multisource => false) do
+ Bundler.settings.temporary(:disable_multisource => false) do
if options[:git]
install_git(names, version, options)
elsif options[:local_git]
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 266a77e220..90f833bef1 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -39,7 +39,7 @@ module Bundler
@gem_version_promoter = gem_version_promoter
@allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
@use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
- @lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ @lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.disable_multisource?
end
def start(requirements)
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 7a14a86ea5..bdd15fe675 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -39,7 +39,6 @@ module Bundler
global_gem_cache
ignore_messages
init_gems_rb
- lockfile_uses_separate_rubygems_sources
no_install
no_prune
only_update_to_newer_versions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 54758c9443..86fd329089 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -51,7 +51,7 @@ module Bundler
end
def can_lock?(spec)
- return super if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ return super if Bundler.feature_flag.disable_multisource?
spec.source.is_a?(Rubygems)
end
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index 173875ce22..d3f649a12c 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require "set"
+
module Bundler
class SourceList
attr_reader :path_sources,
@@ -41,17 +43,14 @@ module Bundler
end
def global_rubygems_source=(uri)
- if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ if Bundler.feature_flag.disable_multisource?
@global_rubygems_source ||= rubygems_aggregate_class.new("remotes" => uri)
end
add_rubygems_remote(uri)
end
def add_rubygems_remote(uri)
- if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
- return if Bundler.feature_flag.disable_multisource?
- raise InvalidOption, "`lockfile_uses_separate_rubygems_sources` cannot be set without `disable_multisource` being set"
- end
+ return if Bundler.feature_flag.disable_multisource?
@rubygems_aggregate.add_remote(uri)
@rubygems_aggregate
end
@@ -78,7 +77,7 @@ module Bundler
def lock_sources
lock_sources = (path_sources + git_sources + plugin_sources).sort_by(&:to_s)
- if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
+ if Bundler.feature_flag.disable_multisource?
lock_sources + rubygems_sources.sort_by(&:to_s)
else
lock_sources << combine_rubygems_sources
@@ -95,7 +94,7 @@ module Bundler
end
end
- replacement_rubygems = !Bundler.feature_flag.lockfile_uses_separate_rubygems_sources? &&
+ replacement_rubygems = !Bundler.feature_flag.disable_multisource? &&
replacement_sources.detect {|s| s.is_a?(Source::Rubygems) }
@rubygems_aggregate = replacement_rubygems if replacement_rubygems
diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb
index 971f1042dc..7df4ba82d3 100644
--- a/spec/bundler/source_list_spec.rb
+++ b/spec/bundler/source_list_spec.rb
@@ -372,7 +372,7 @@ RSpec.describe Bundler::SourceList do
source_list.add_git_source("uri" => "git://first-git.org/path.git")
end
- it "combines the rubygems sources into a single instance, removing duplicate remotes from the end", :bundler => "< 2" do
+ it "combines the rubygems sources into a single instance, removing duplicate remotes from the end", :bundler => "< 3" do
expect(source_list.lock_sources).to eq [
Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"),
Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"),
@@ -391,7 +391,7 @@ RSpec.describe Bundler::SourceList do
]
end
- it "returns all sources, without combining rubygems sources", :bundler => "2" do
+ it "returns all sources, without combining rubygems sources", :bundler => "3" do
expect(source_list.lock_sources).to eq [
Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"),
Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"),
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index 35b5eaea00..bf1de25142 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -693,6 +693,7 @@ RSpec.describe "bundle exec" do
end
let(:exit_code) { Bundler::GemNotFound.new.status_code }
+ let(:expected_err) { "" }
let(:expected) { <<-EOS.strip }
\e[31mCould not find gem 'rack (= 2)' in any of the gem sources listed in your Gemfile.\e[0m
\e[33mRun `bundle install` to install missing gems.\e[0m
@@ -712,6 +713,24 @@ RSpec.describe "bundle exec" do
let(:exit_code) { Bundler::GemNotFound.new.status_code }
let(:expected) { "" }
let(:expected_err) { <<-EOS.strip }
+\e[31mCould not find gem 'rack (= 2)' in any of the gem sources listed in your Gemfile.\e[0m
+\e[33mRun `bundle install` to install missing gems.\e[0m
+ EOS
+
+ it_behaves_like "it runs"
+ end
+
+ context "when Bundler.setup fails", :bundler => "3" do
+ before do
+ gemfile <<-G
+ gem 'rack', '2'
+ G
+ ENV["BUNDLER_FORCE_TTY"] = "true"
+ end
+
+ let(:exit_code) { Bundler::GemNotFound.new.status_code }
+ let(:expected) { "" }
+ let(:expected_err) { <<-EOS.strip }
\e[31mCould not find gem 'rack (= 2)' in locally installed gems.
The source contains 'rack' at: 1.0.0\e[0m
\e[33mRun `bundle install` to install missing gems.\e[0m
diff --git a/spec/commands/list_spec.rb b/spec/commands/list_spec.rb
index 613249cc59..e88d7bfb04 100644
--- a/spec/commands/list_spec.rb
+++ b/spec/commands/list_spec.rb
@@ -1,15 +1,6 @@
# frozen_string_literal: true
RSpec.describe "bundle list", :bundler => ">= 2" do
- before do
- install_gemfile <<-G
- source "file://#{gem_repo1}"
-
- gem "rack"
- gem "rspec", :group => [:test]
- G
- end
-
context "with name-only and paths option" do
it "raises an error" do
bundle "list --name-only --paths"
@@ -27,6 +18,15 @@ RSpec.describe "bundle list", :bundler => ">= 2" do
end
describe "with without-group option" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ gem "rspec", :group => [:test]
+ G
+ end
+
context "when group is present" do
it "prints the gems not in the specified group" do
bundle! "list --without-group test"
@@ -46,6 +46,15 @@ RSpec.describe "bundle list", :bundler => ">= 2" do
end
describe "with only-group option" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ gem "rspec", :group => [:test]
+ G
+ end
+
context "when group is present" do
it "prints the gems in the specified group" do
bundle! "list --only-group default"
@@ -65,6 +74,15 @@ RSpec.describe "bundle list", :bundler => ">= 2" do
end
context "with name-only option" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ gem "rspec", :group => [:test]
+ G
+ end
+
it "prints only the name of the gems in the bundle" do
bundle "list --name-only"
@@ -82,7 +100,6 @@ RSpec.describe "bundle list", :bundler => ">= 2" do
build_git "git_test", "1.0.0", :path => lib_path("git_test")
build_lib("gemspec_test", :path => tmp.join("gemspec_test")) do |s|
- s.write("Gemfile", "source :rubygems\ngemspec")
s.add_dependency "bar", "=1.0.0"
end
@@ -93,8 +110,6 @@ RSpec.describe "bundle list", :bundler => ">= 2" do
gem "git_test", :git => "#{lib_path("git_test")}"
gemspec :path => "#{tmp.join("gemspec_test")}"
G
-
- bundle! "install"
end
it "prints the path of each gem in the bundle" do
@@ -119,13 +134,35 @@ RSpec.describe "bundle list", :bundler => ">= 2" do
end
end
- it "lists gems installed in the bundle" do
- bundle "list"
- expect(out).to include(" * rack (1.0.0)")
+ context "without options" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ gem "rspec", :group => [:test]
+ G
+ end
+
+ it "lists gems installed in the bundle" do
+ bundle "list"
+ expect(out).to include(" * rack (1.0.0)")
+ end
end
- it "aliases the ls command to list" do
- bundle "ls"
- expect(out).to include("Gems included by the bundle")
+ context "when using the ls alias" do
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ gem "rspec", :group => [:test]
+ G
+ end
+
+ it "runs the list command" do
+ bundle "ls"
+ expect(out).to include("Gems included by the bundle")
+ end
end
end
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index b0de8a1f20..8e1205dfa3 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "with multiple toplevel sources", :bundler => "< 2" do
+ context "with multiple toplevel sources", :bundler => "< 3" do
let(:repo3_rack_version) { "1.0.0" }
before do
@@ -27,13 +27,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- xit "shows a deprecation" do
- bundle :install
-
- expect(deprecations).to include("Your Gemfile contains multiple primary sources.")
- end
-
- it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first" do
+ it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "2" do
bundle :install
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
@@ -41,15 +35,14 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1")
end
- it "errors when disable_multisource is set" do
- bundle "config set disable_multisource true"
+ it "fails", :bundler => "3" do
bundle :install
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4) if exitstatus
end
end
- context "when different versions of the same gem are in multiple sources", :bundler => "< 2" do
+ context "when different versions of the same gem are in multiple sources", :bundler => "< 3" do
let(:repo3_rack_version) { "1.2" }
before do
@@ -63,15 +56,16 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle :install
end
- xit "shows a deprecation" do
- expect(deprecations).to include("Your Gemfile contains multiple primary sources.")
- end
-
- it "warns about ambiguous gems, but installs anyway" do
+ it "warns about ambiguous gems, but installs anyway", :bundler => "2" do
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(err).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo1}"))
expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1")
end
+
+ it "fails", :bundler => "3" do
+ expect(err).to include("Each source after the first must include a block")
+ expect(exitstatus).to eq(4) if exitstatus
+ end
end
end
@@ -193,9 +187,8 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "when lockfile_uses_separate_rubygems_sources is set" do
+ context "when disable_multisource is set" do
before do
- bundle! "config set lockfile_uses_separate_rubygems_sources true"
bundle! "config set disable_multisource true"
end
@@ -243,7 +236,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "and in yet another source", :bundler => "< 2" do
+ context "and in yet another source", :bundler => "< 3" do
before do
gemfile <<-G
source "file://localhost#{gem_repo1}"
@@ -256,18 +249,19 @@ RSpec.describe "bundle install with gems on multiple sources" do
bundle :install
end
- xit "shows a deprecation" do
- expect(deprecations).to include("Your Gemfile contains multiple primary sources.")
- end
-
- it "installs from the other source and warns about ambiguous gems" do
+ it "installs from the other source and warns about ambiguous gems", :bundler => "2" do
expect(err).to include("Warning: the gem 'rack' was found in multiple sources.")
expect(err).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo2}"))
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
end
+
+ it "fails", :bundler => "3" do
+ expect(err).to include("Each source after the first must include a block")
+ expect(exitstatus).to eq(4) if exitstatus
+ end
end
- context "and only the dependency is pinned", :bundler => "< 2" do
+ context "and only the dependency is pinned", :bundler => "< 3" do
before do
# need this to be broken to check for correct source ordering
build_repo gem_repo2 do
@@ -285,7 +279,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
G
end
- it "installs the dependency from the pinned source without warning" do
+ it "installs the dependency from the pinned source without warning", :bundler => "2" do
bundle :install
expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
@@ -299,14 +293,19 @@ RSpec.describe "bundle install with gems on multiple sources" do
expect(err).not_to include("Warning: the gem 'rack' was found in multiple sources.")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0")
end
+
+ it "fails", :bundler => "3" do
+ bundle :install
+ expect(err).to include("Each source after the first must include a block")
+ expect(exitstatus).to eq(4) if exitstatus
+ end
end
end
end
context "when a top-level gem has an indirect dependency" do
- context "when lockfile_uses_separate_rubygems_sources is set" do
+ context "when disable_multisource is set" do
before do
- bundle! "config set lockfile_uses_separate_rubygems_sources true"
bundle! "config set disable_multisource true"
end
@@ -626,7 +625,39 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
end
- context "when a gem is available from multiple ambiguous sources", :bundler => "2" do
+ describe "source changed to one containing a higher version of a dependency" do
+ before do
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack"
+ G
+
+ build_repo2 do
+ build_gem "bar"
+ end
+
+ build_lib("gemspec_test", :path => tmp.join("gemspec_test")) do |s|
+ s.add_dependency "bar", "=1.0.0"
+ end
+
+ install_gemfile <<-G
+ source "file://#{gem_repo2}"
+ gem "rack"
+ gemspec :path => "#{tmp.join("gemspec_test")}"
+ G
+ end
+
+ it "keeps the old version", :bundler => "2" do
+ expect(the_bundle).to include_gems("rack 1.0.0")
+ end
+
+ it "installs the higher version in the new repo", :bundler => "3" do
+ expect(the_bundle).to include_gems("rack 1.2")
+ end
+ end
+
+ context "when a gem is available from multiple ambiguous sources", :bundler => "3" do
it "raises, suggesting a source block" do
build_repo4 do
build_gem "depends_on_rack" do |s|
diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb
index 12bc2877ff..aeb83d6573 100644
--- a/spec/install/gems/flex_spec.rb
+++ b/spec/install/gems/flex_spec.rb
@@ -244,7 +244,7 @@ RSpec.describe "bundle flex_install" do
end
describe "when adding a new source" do
- it "updates the lockfile", :bundler => "< 2" do
+ it "updates the lockfile", :bundler => "< 3" do
build_repo2
install_gemfile! <<-G
source "file://localhost#{gem_repo1}"
@@ -264,7 +264,7 @@ RSpec.describe "bundle flex_install" do
rack (1.0.0)
PLATFORMS
- ruby
+ #{lockfile_platforms}
DEPENDENCIES
rack
@@ -274,7 +274,7 @@ RSpec.describe "bundle flex_install" do
L
end
- it "updates the lockfile", :bundler => "2" do
+ it "updates the lockfile", :bundler => "3" do
build_repo2
install_gemfile! <<-G
source "file://localhost#{gem_repo1}"
diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb
index 602373896d..1ea21a6635 100644
--- a/spec/install/post_bundle_message_spec.rb
+++ b/spec/install/post_bundle_message_spec.rb
@@ -101,16 +101,16 @@ RSpec.describe "post bundle message" do
end
describe "with misspelled or non-existent gem name" do
- it "should report a helpful error message", :bundler => "< 2" do
+ it "should report a helpful error message", :bundler => "< 3" do
install_gemfile <<-G
source "file://localhost#{gem_repo1}"
gem "rack"
gem "not-a-gem", :group => :development
G
- expect(out).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your Gemfile.")
+ expect(err).to include("Could not find gem 'not-a-gem' in any of the gem sources listed in your Gemfile.")
end
- it "should report a helpful error message", :bundler => "2" do
+ it "should report a helpful error message", :bundler => "3" do
install_gemfile <<-G
source "file://localhost#{gem_repo1}"
gem "rack"
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index c07c4e1db8..0bab70066e 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -415,7 +415,7 @@ RSpec.describe "the lockfile format" do
G
end
- it "generates a lockfile without credentials for a configured source", :bundler => "< 2" do
+ it "generates a lockfile without credentials for a configured source", :bundler => "< 3" do
bundle "config set http://localgemserver.test/ user:pass"
install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
@@ -448,7 +448,7 @@ RSpec.describe "the lockfile format" do
G
end
- it "generates a lockfile without credentials for a configured source", :bundler => "2" do
+ it "generates a lockfile without credentials for a configured source", :bundler => "3" do
bundle "config set http://localgemserver.test/ user:pass"
install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index d041fd13bd..cd8b721609 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -345,6 +345,30 @@ RSpec.describe "major deprecations" do
end
end
+ context "bundle install with multiple sources" do
+ before do
+ install_gemfile <<-G
+ source "file://localhost#{gem_repo3}"
+ source "file://localhost#{gem_repo1}"
+ G
+ end
+
+ it "does not print a deprecation warning", :bundler => "< 2" do
+ expect(deprecations).to be_empty
+ end
+
+ it "shows a deprecation", :bundler => "2" do
+ expect(deprecations).to include(
+ "Your Gemfile contains multiple primary sources. " \
+ "Using `source` more than once without a block is a security risk, and " \
+ "may result in installing unexpected gems. To resolve this warning, use " \
+ "a block to indicate which gems should come from the secondary source. " \
+ "To upgrade this warning to an error, run `bundle config set " \
+ "disable_multisource true`."
+ )
+ end
+ end
+
context "when Bundler.setup is run in a ruby script" do
before do
create_file "gems.rb"
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index c9df900647..f9c815aee1 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -173,7 +173,6 @@ RSpec.describe "The library itself" do
gem.mit
github.https
inline
- lockfile_uses_separate_rubygems_sources
use_gem_version_promoter_for_major_updates
]