summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gems
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-06-03 18:43:17 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-06-18 19:14:15 +0900
commit61b6f53337cb71b35c56d480ec6044ba7e85cb71 (patch)
tree02cb7fb6e175c9114a87bee50551334a2f7358fb /spec/bundler/install/gems
parent529a9e8a1f804332461a8519fe46dd78f3cb4265 (diff)
[rubygems/rubygems] Make helpers raise by default
https://github.com/rubygems/rubygems/commit/ade0c441d5
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3212
Diffstat (limited to 'spec/bundler/install/gems')
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb22
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb14
-rw-r--r--spec/bundler/install/gems/flex_spec.rb10
-rw-r--r--spec/bundler/install/gems/resolving_spec.rb4
-rw-r--r--spec/bundler/install/gems/standalone_spec.rb2
5 files changed, 26 insertions, 26 deletions
diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb
index 49ea82e56d..aa81459924 100644
--- a/spec/bundler/install/gems/compact_index_spec.rb
+++ b/spec/bundler/install/gems/compact_index_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe "compact index api" do
gem " sinatra"
G
- bundle :install, :artifice => "compact_index"
+ bundle :install, :artifice => "compact_index", :raise_on_error => false
expect(err).to include("' sinatra' is not a valid gem name because it contains whitespace.")
end
@@ -229,7 +229,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle :install, :artifice => "compact_index_redirects"
+ bundle :install, :artifice => "compact_index_redirects", :raise_on_error => false
expect(err).to match(/Too many redirects/)
end
@@ -617,7 +617,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle :install, :artifice => "endpoint_500"
+ bundle :install, :artifice => "endpoint_500", :raise_on_error => false
expect(out).not_to include("#{user}:#{password}")
end
@@ -691,14 +691,14 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "shows instructions if auth is not provided for the source" do
- bundle :install, :artifice => "compact_index_strict_basic_authentication"
+ bundle :install, :artifice => "compact_index_strict_basic_authentication", :raise_on_error => false
expect(err).to include("bundle config set #{source_hostname} username:password")
end
it "fails if authentication has already been provided, but failed" do
bundle "config set #{source_hostname} #{user}:wrong"
- bundle :install, :artifice => "compact_index_strict_basic_authentication"
+ bundle :install, :artifice => "compact_index_strict_basic_authentication", :raise_on_error => false
expect(err).to include("Bad username or password")
end
end
@@ -737,7 +737,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle :install, :env => { "RUBYOPT" => opt_add("-I#{bundled_app("broken_ssl")}", ENV["RUBYOPT"]) }
+ bundle :install, :env => { "RUBYOPT" => opt_add("-I#{bundled_app("broken_ssl")}", ENV["RUBYOPT"]) }, :raise_on_error => false
expect(err).to include("OpenSSL")
end
end
@@ -757,7 +757,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle :install
+ bundle :install, :raise_on_error => false
expect(err).to match(/could not verify the SSL certificate/i)
end
end
@@ -856,7 +856,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "fails gracefully when the source URI has an invalid scheme" do
- install_gemfile <<-G
+ install_gemfile <<-G, :raise_on_error => false
source "htps://rubygems.org"
gem "rack"
G
@@ -868,7 +868,7 @@ The checksum of /versions does not match the checksum provided by the server! So
describe "checksum validation" do
it "raises when the checksum does not match" do
- install_gemfile <<-G, :artifice => "compact_index_wrong_gem_checksum"
+ install_gemfile <<-G, :artifice => "compact_index_wrong_gem_checksum", :raise_on_error => false
source "#{source_uri}"
gem "rack"
G
@@ -888,7 +888,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "raises when the checksum is the wrong length" do
- install_gemfile <<-G, :artifice => "compact_index_wrong_gem_checksum", :env => { "BUNDLER_SPEC_RACK_CHECKSUM" => "checksum!", "DEBUG" => "1" }, :verbose => true
+ install_gemfile <<-G, :artifice => "compact_index_wrong_gem_checksum", :env => { "BUNDLER_SPEC_RACK_CHECKSUM" => "checksum!", "DEBUG" => "1" }, :verbose => true, :raise_on_error => false
source "#{source_uri}"
gem "rack"
G
@@ -914,7 +914,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "doesn't explode when the API dependencies are wrong" do
- install_gemfile <<-G, :artifice => "compact_index_wrong_dependencies", :env => { "DEBUG" => "true" }
+ install_gemfile <<-G, :artifice => "compact_index_wrong_dependencies", :env => { "DEBUG" => "true" }, :raise_on_error => false
source "#{source_uri}"
gem "rails"
G
diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb
index 2927e19649..7fe2bec721 100644
--- a/spec/bundler/install/gems/dependency_api_spec.rb
+++ b/spec/bundler/install/gems/dependency_api_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe "gemcutter's dependency API" do
gem " sinatra"
G
- bundle :install, :artifice => "endpoint"
+ bundle :install, :artifice => "endpoint", :raise_on_error => false
expect(err).to include("' sinatra' is not a valid gem name because it contains whitespace.")
end
@@ -219,7 +219,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle :install, :artifice => "endpoint_redirect"
+ bundle :install, :artifice => "endpoint_redirect", :raise_on_error => false
expect(err).to match(/Too many redirects/)
end
@@ -591,7 +591,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle :install, :artifice => "endpoint_500"
+ bundle :install, :artifice => "endpoint_500", :raise_on_error => false
expect(out).not_to include("#{user}:#{password}")
end
@@ -665,14 +665,14 @@ RSpec.describe "gemcutter's dependency API" do
end
it "shows instructions if auth is not provided for the source" do
- bundle :install, :artifice => "endpoint_strict_basic_authentication"
+ bundle :install, :artifice => "endpoint_strict_basic_authentication", :raise_on_error => false
expect(err).to include("bundle config set #{source_hostname} username:password")
end
it "fails if authentication has already been provided, but failed" do
bundle "config set #{source_hostname} #{user}:wrong"
- bundle :install, :artifice => "endpoint_strict_basic_authentication"
+ bundle :install, :artifice => "endpoint_strict_basic_authentication", :raise_on_error => false
expect(err).to include("Bad username or password")
end
end
@@ -711,7 +711,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle :install, :env => { "RUBYOPT" => opt_add("-I#{bundled_app("broken_ssl")}", ENV["RUBYOPT"]) }
+ bundle :install, :env => { "RUBYOPT" => opt_add("-I#{bundled_app("broken_ssl")}", ENV["RUBYOPT"]) }, :raise_on_error => false
expect(err).to include("OpenSSL")
end
end
@@ -731,7 +731,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle :install
+ bundle :install, :raise_on_error => false
expect(err).to match(/could not verify the SSL certificate/i)
end
end
diff --git a/spec/bundler/install/gems/flex_spec.rb b/spec/bundler/install/gems/flex_spec.rb
index 77891acc24..42b760822d 100644
--- a/spec/bundler/install/gems/flex_spec.rb
+++ b/spec/bundler/install/gems/flex_spec.rb
@@ -184,8 +184,8 @@ RSpec.describe "bundle flex_install" do
end
it "does not install gems whose dependencies are not met" do
- bundle :install
- ruby <<-RUBY
+ bundle :install, :raise_on_error => false
+ ruby <<-RUBY, :raise_on_error => false
require 'bundler/setup'
RUBY
expect(err).to match(/could not find gem 'rack-obama/i)
@@ -210,7 +210,7 @@ RSpec.describe "bundle flex_install" do
the gems in your Gemfile, which may resolve the conflict.
E
- bundle :install, :retry => 0
+ bundle :install, :retry => 0, :raise_on_error => false
expect(err).to end_with(nice_error)
end
end
@@ -232,7 +232,7 @@ RSpec.describe "bundle flex_install" do
it "does something" do
expect do
- bundle "install"
+ bundle "install", :raise_on_error => false
end.not_to change { File.read(bundled_app_lock) }
expect(err).to include("rack = 0.9.1")
@@ -341,7 +341,7 @@ RSpec.describe "bundle flex_install" do
G
# upgrade Rails to 3.0.0 and then install again
- install_gemfile <<-G
+ install_gemfile <<-G, :raise_on_error => false
source "#{file_uri_for(gem_repo2)}"
gem "rails", "3.0.0"
gem "capybara", "0.3.9"
diff --git a/spec/bundler/install/gems/resolving_spec.rb b/spec/bundler/install/gems/resolving_spec.rb
index 315d615604..f72220ef21 100644
--- a/spec/bundler/install/gems/resolving_spec.rb
+++ b/spec/bundler/install/gems/resolving_spec.rb
@@ -207,7 +207,7 @@ RSpec.describe "bundle install with install-time dependencies" do
it "raises an error during resolution" do
skip "ruby requirement includes platform and it shouldn't" if Gem.win_platform?
- install_gemfile <<-G, :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }
+ install_gemfile <<-G, :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo2.to_s }, :raise_on_error => false
source "http://localgemserver.test/"
ruby #{ruby_requirement}
gem 'require_ruby'
@@ -256,7 +256,7 @@ RSpec.describe "bundle install with install-time dependencies" do
end
end
- install_gemfile <<-G
+ install_gemfile <<-G, :raise_on_error => false
source "#{file_uri_for(gem_repo2)}"
gem 'require_rubygems'
G
diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb
index 8cb6cd6588..6d7828a416 100644
--- a/spec/bundler/install/gems/standalone_spec.rb
+++ b/spec/bundler/install/gems/standalone_spec.rb
@@ -106,7 +106,7 @@ RSpec.shared_examples "bundle install --standalone" do
G
end
bundle "config --local path #{bundled_app("bundle")}"
- install_gemfile <<-G, :standalone => true, :dir => cwd
+ install_gemfile <<-G, :standalone => true, :dir => cwd, :raise_on_error => false
gem "bar", :git => "#{lib_path("bar-1.0")}"
G
end