summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-27 09:52:15 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-28 16:41:23 +0100
commitc425c5cd2b987a5b4c2c397b5308618241dcacbd (patch)
treea6b3441f61c1b59bc1df948c2e420d135c4297e3
parentae11272b8afe7adc7b5ad297bcd14afe39e397a4 (diff)
downloadbundler-c425c5cd2b987a5b4c2c397b5308618241dcacbd.tar.gz
Prefer the `err` helper for checking errors
The helper already considers the stream errors are printed to.
-rw-r--r--spec/install/gemfile/sources_spec.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index b29346c800..96aa5a1803 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -30,9 +30,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 2" do
bundle :install
- expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
- expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(out).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo1}"))
+ expect(err).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
+ 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
@@ -59,9 +59,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do
- expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
- expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(out).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo1}"))
+ expect(err).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
+ 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
end
@@ -249,9 +249,9 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs from the other source and warns about ambiguous gems", :bundler => "< 2" do
- expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
- expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
- expect(out).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo2}"))
+ expect(err).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
+ 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
end
@@ -277,7 +277,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs the dependency from the pinned source without warning", :bundler => "< 2" do
bundle :install
- expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
+ 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")
# In https://github.com/bundler/bundler/issues/3585 this failed
@@ -285,7 +285,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
system_gems []
bundle :install
- expect(out).not_to include("Warning: the gem 'rack' was found in multiple sources.")
+ 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
end
@@ -330,7 +330,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs all gems without warning" do
bundle :install
- expect(out).not_to include("Warning")
+ expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
end
end
@@ -365,7 +365,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs the dependency from the top-level source without warning" do
bundle :install
- expect(out).not_to include("Warning")
+ expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0")
end
end
@@ -454,7 +454,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "installs the gems without any warning" do
bundle :install
- expect(out).not_to include("Warning")
+ expect(err).not_to include("Warning")
expect(the_bundle).to include_gems("rack 1.0.0")
end
end
@@ -632,7 +632,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "depends_on_rack"
G
expect(last_command).to be_failure
- expect(last_command.stderr).to eq normalize_uri_file(strip_whitespace(<<-EOS).strip)
+ expect(err).to eq normalize_uri_file(strip_whitespace(<<-EOS).strip)
The gem 'rack' was found in multiple relevant sources.
* rubygems repository file://localhost#{gem_repo1}/ or installed locally
* rubygems repository file://localhost#{gem_repo4}/ or installed locally