summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-03-21 12:51:05 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-08 13:04:26 +0200
commit2ef1190881534529df47244079e6bf41c9425f24 (patch)
tree4eb7d84d83f2c11cad86545e0e5e2c7941039314
parent645a3d862a99f745ab1fdbc86b375a13e81f06f4 (diff)
downloadbundler-2ef1190881534529df47244079e6bf41c9425f24.tar.gz
Unify multiple source deprecation specs
Move them to the file where all deprecations are tested. And test just the simple case, since the deprecations logic should be the same for all cases.
-rw-r--r--spec/install/gemfile/sources_spec.rb14
-rw-r--r--spec/other/major_deprecation_spec.rb17
2 files changed, 17 insertions, 14 deletions
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index b0de8a1f20..371b2bc85c 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -27,12 +27,6 @@ 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
bundle :install
@@ -63,10 +57,6 @@ 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
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}"))
@@ -256,10 +246,6 @@ 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
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}"))
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index d041fd13bd..a19a4c47a1 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -345,6 +345,23 @@ 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
+
+ xit "shows a deprecation", :bundler => "2" do
+ expect(deprecations).to include("Your Gemfile contains multiple primary sources.")
+ end
+ end
+
context "when Bundler.setup is run in a ruby script" do
before do
create_file "gems.rb"