diff options
Diffstat (limited to 'spec/bundler/install')
21 files changed, 106 insertions, 108 deletions
diff --git a/spec/bundler/install/allow_offline_install_spec.rb b/spec/bundler/install/allow_offline_install_spec.rb index 7813a3426d..da71f09ab8 100644 --- a/spec/bundler/install/allow_offline_install_spec.rb +++ b/spec/bundler/install/allow_offline_install_spec.rb @@ -15,7 +15,7 @@ RSpec.describe "bundle install with :allow_offline_install" do end it "still fails when the network is down" do - install_gemfile <<-G, :artifice => "fail" + install_gemfile <<-G, :artifice => "fail", :raise_on_error => false source "http://testgemserver.local" gem "rack-obama" G diff --git a/spec/bundler/install/bundler_spec.rb b/spec/bundler/install/bundler_spec.rb index 9667f80435..f4e9ffb786 100644 --- a/spec/bundler/install/bundler_spec.rb +++ b/spec/bundler/install/bundler_spec.rb @@ -32,7 +32,7 @@ RSpec.describe "bundle install" do it "causes a conflict if explicitly requesting a different version" do bundle "config set force_ruby_platform true" - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo2)}" gem "rails", "3.0" gem "bundler", "0.9.2" @@ -93,7 +93,7 @@ RSpec.describe "bundle install" do it "causes a conflict if child dependencies conflict" do bundle "config set force_ruby_platform true" - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo2)}" gem "activemerchant" gem "rails_pinned_to_old_activesupport" @@ -114,7 +114,7 @@ RSpec.describe "bundle install" do it "causes a conflict if a child dependency conflicts with the Gemfile" do bundle "config set force_ruby_platform true" - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo2)}" gem "rails_pinned_to_old_activesupport" gem "activesupport", "2.3.5" diff --git a/spec/bundler/install/deploy_spec.rb b/spec/bundler/install/deploy_spec.rb index 1f6abc23a5..ffb021c798 100644 --- a/spec/bundler/install/deploy_spec.rb +++ b/spec/bundler/install/deploy_spec.rb @@ -10,24 +10,24 @@ RSpec.describe "install in deployment or frozen mode" do context "with CLI flags", :bundler => "< 3" do it "fails without a lockfile and says that --deployment requires a lock" do - bundle "install --deployment" + bundle "install --deployment", :raise_on_error => false expect(err).to include("The --deployment flag requires a Gemfile.lock") end it "fails without a lockfile and says that --frozen requires a lock" do - bundle "install --frozen" + bundle "install --frozen", :raise_on_error => false expect(err).to include("The --frozen flag requires a Gemfile.lock") end it "disallows --deployment --system" do - bundle "install --deployment --system" + bundle "install --deployment --system", :raise_on_error => false expect(err).to include("You have specified both --deployment") expect(err).to include("Please choose only one option") expect(exitstatus).to eq(15) if exitstatus end it "disallows --deployment --path --system" do - bundle "install --deployment --path . --system" + bundle "install --deployment --path . --system", :raise_on_error => false expect(err).to include("You have specified both --path") expect(err).to include("as well as --system") expect(err).to include("Please choose only one option") @@ -35,7 +35,7 @@ RSpec.describe "install in deployment or frozen mode" do end it "doesn't mess up a subsequent `bundle install` after you try to deploy without a lock" do - bundle "install --deployment" + bundle "install --deployment", :raise_on_error => false bundle! :install expect(the_bundle).to include_gems "rack 1.0" end @@ -135,7 +135,7 @@ RSpec.describe "install in deployment or frozen mode" do end it "prevents the replace by default" do - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/The list of sources changed/) end @@ -154,7 +154,7 @@ RSpec.describe "install in deployment or frozen mode" do before { bundle! "config set allow_deployment_source_credential_changes false" } it "prevents the replace" do - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/The list of sources changed/) end @@ -174,7 +174,7 @@ RSpec.describe "install in deployment or frozen mode" do before { ENV["BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES"] = "false" } it "prevents the replace" do - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/The list of sources changed/) end @@ -216,7 +216,7 @@ RSpec.describe "install in deployment or frozen mode" do G bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have added to the Gemfile") expect(err).to include("* rack-obama") @@ -254,7 +254,7 @@ RSpec.describe "install in deployment or frozen mode" do bundle "config --local path .bundle" bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("The path `#{lib_path("path_gem-1.0")}` does not exist.") end @@ -266,7 +266,7 @@ RSpec.describe "install in deployment or frozen mode" do G ENV["BUNDLE_FROZEN"] = "1" - bundle "install" + bundle "install", :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have added to the Gemfile") expect(err).to include("* rack-obama") @@ -282,7 +282,7 @@ RSpec.describe "install in deployment or frozen mode" do G ENV["BUNDLE_DEPLOYMENT"] = "true" - bundle "install" + bundle "install", :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have added to the Gemfile") expect(err).to include("* rack-obama") @@ -325,7 +325,7 @@ RSpec.describe "install in deployment or frozen mode" do G bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have added to the Gemfile:\n* activesupport\n\n") expect(err).to include("You have deleted from the Gemfile:\n* rack") @@ -339,7 +339,7 @@ RSpec.describe "install in deployment or frozen mode" do G bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have added to the Gemfile:\n* source: git://hubz.com (at master)") expect(err).not_to include("You have changed in the Gemfile") @@ -359,7 +359,7 @@ RSpec.describe "install in deployment or frozen mode" do G bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}") expect(err).not_to include("You have added to the Gemfile") @@ -383,7 +383,7 @@ RSpec.describe "install in deployment or frozen mode" do G bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("deployment mode") expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`") expect(err).not_to include("You have added to the Gemfile") diff --git a/spec/bundler/install/failure_spec.rb b/spec/bundler/install/failure_spec.rb index 57ffafd588..d265fafa63 100644 --- a/spec/bundler/install/failure_spec.rb +++ b/spec/bundler/install/failure_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "bundle install" do end end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo2)}" gem "rails" G @@ -40,7 +40,7 @@ In Gemfile: RUBY end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo1)}" gem "rails" gem "activesupport", :git => "#{lib_path("activesupport")}" @@ -68,7 +68,7 @@ In Gemfile: RUBY end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo1)}" gem "rails" @@ -105,7 +105,7 @@ In Gemfile: build_gem "a" end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo2)}" do gem "rails" @@ -132,7 +132,7 @@ In Gemfile: end it "removes the downloaded .gem" do - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo4)}" gem "a" G diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index 06ebf6c3e0..4b0df954c9 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -61,7 +61,7 @@ RSpec.describe "bundle install from an existing gemspec" do it "should raise if there are no gemspecs available" do build_lib("foo", :path => tmp.join("foo"), :gemspec => false) - install_gemfile(<<-G) + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G @@ -73,7 +73,7 @@ RSpec.describe "bundle install from an existing gemspec" do s.write("foo2.gemspec", build_spec("foo", "4.0").first.to_ruby) end - install_gemfile(<<-G) + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G @@ -189,7 +189,7 @@ RSpec.describe "bundle install from an existing gemspec" do s.write "raise 'ahh' unless Dir.pwd == '#{tmp.join("foo")}'" end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gemspec :path => '#{tmp.join("foo")}' G expect(last_command.stdboth).not_to include("ahh") @@ -292,7 +292,7 @@ RSpec.describe "bundle install from an existing gemspec" do end bundle "config --local deployment true" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("changed") end diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb index cc2da8bec4..560d2a4495 100644 --- a/spec/bundler/install/gemfile/git_spec.rb +++ b/spec/bundler/install/gemfile/git_spec.rb @@ -79,7 +79,7 @@ RSpec.describe "bundle install with git sources" do it "complains if pinned specs don't exist in the git repo" do build_git "foo" - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gem "foo", "1.1", :git => "#{lib_path("foo-1.0")}" G @@ -93,7 +93,7 @@ RSpec.describe "bundle install with git sources" do s.platform = "java" end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false platforms :jruby do gem "only_java", "1.2", :git => "#{lib_path("only_java-1.0-java")}" end @@ -114,7 +114,7 @@ RSpec.describe "bundle install with git sources" do s.write "only_java1-0.gemspec", File.read("#{lib_path("only_java-1.0-java")}/only_java.gemspec") end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false platforms :jruby do gem "only_java", "1.2", :git => "#{lib_path("only_java-1.1-java")}" end @@ -510,7 +510,7 @@ RSpec.describe "bundle install with git sources" do G bundle %(config set local.rack #{lib_path("local-rack")}) - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/) solution = "config unset local.rack" @@ -532,7 +532,7 @@ RSpec.describe "bundle install with git sources" do G bundle %(config set local.rack #{lib_path("local-rack")}) - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/Cannot use local override for rack-0.8 at #{Regexp.escape(lib_path('local-rack').to_s)} because :branch is not specified in Gemfile/) solution = "config unset local.rack" @@ -574,7 +574,7 @@ RSpec.describe "bundle install with git sources" do G bundle %(config set local.rack #{lib_path("local-rack")}) - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/is using branch another but Gemfile specifies master/) end @@ -591,7 +591,7 @@ RSpec.describe "bundle install with git sources" do G bundle %(config set local.rack #{lib_path("local-rack")}) - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/The Gemfile lock is pointing to revision \w+/) end end @@ -789,7 +789,7 @@ RSpec.describe "bundle install with git sources" do gem "foo", "1.0", :git => "omgomg" G - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("Git error:") expect(err).to include("fatal") @@ -837,7 +837,7 @@ RSpec.describe "bundle install with git sources" do sys_exec "git submodule add #{lib_path("submodule-1.0")} submodule-1.0", :dir => lib_path("has_submodule-1.0") sys_exec "git commit -m \"submodulator\"", :dir => lib_path("has_submodule-1.0") - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false git "#{lib_path("has_submodule-1.0")}" do gem "has_submodule" end @@ -923,7 +923,7 @@ RSpec.describe "bundle install with git sources" do FileUtils.mkdir_p(default_bundle_path) FileUtils.touch(default_bundle_path("bundler")) - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1027,7 +1027,7 @@ RSpec.describe "bundle install with git sources" do G expect(out).to_not match(/Revision.*does not exist/) - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gem "foo", :git => "#{file_uri_for(lib_path("foo-1.0"))}", :ref => "deadbeef" G expect(err).to include("Revision deadbeef does not exist in the repository") @@ -1103,8 +1103,7 @@ RSpec.describe "bundle install with git sources" do H end - bundle :install, - :requires => [lib_path("install_hooks.rb")] + bundle :install, :requires => [lib_path("install_hooks.rb")], :raise_on_error => false expect(err).to include("failed for foo-1.0") end end @@ -1189,7 +1188,7 @@ RSpec.describe "bundle install with git sources" do RUBY end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1376,7 +1375,7 @@ In Gemfile: G with_path_as("") do - bundle "update", :all => true + bundle "update", :all => true, :raise_on_error => false end expect(err). to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git") @@ -1429,7 +1428,7 @@ In Gemfile: let(:credentials) { "user1:password1" } it "does not display the password" do - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false git "https://#{credentials}@github.com/company/private-repo" do gem "foo" end @@ -1444,7 +1443,7 @@ In Gemfile: let(:credentials) { "oauth_token" } it "displays the oauth scheme but not the oauth token" do - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false git "https://#{credentials}:x-oauth-basic@github.com/company/private-repo" do gem "foo" end diff --git a/spec/bundler/install/gemfile/groups_spec.rb b/spec/bundler/install/gemfile/groups_spec.rb index f222731559..8d3ca4b117 100644 --- a/spec/bundler/install/gemfile/groups_spec.rb +++ b/spec/bundler/install/gemfile/groups_spec.rb @@ -205,12 +205,12 @@ RSpec.describe "bundle install with groups" do it "removes groups from with when passed at --without", :bundler => "< 3" do bundle "config --local with debugging" - bundle "install --without debugging" + bundle "install --without debugging", :raise_on_error => false expect(the_bundle).not_to include_gem "thin 1.0" end it "errors out when passing a group to with and without via CLI flags", :bundler => "< 3" do - bundle "install --with emo debugging --without emo" + bundle "install --with emo debugging --without emo", :raise_on_error => false expect(last_command).to be_failure expect(err).to include("The offending groups are: emo") end diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index 44a61ed714..bd38643430 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -65,7 +65,7 @@ RSpec.describe "bundle install with explicit source paths" do username = "some_unexisting_user" relative_path = lib_path("foo-1.0").relative_path_from(Pathname.new("/home/#{username}").expand_path) - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gem 'foo', :path => "~#{username}/#{relative_path}" G expect(err).to match("There was an error while trying to use the path `~#{username}/#{relative_path}`.") @@ -223,7 +223,7 @@ RSpec.describe "bundle install with explicit source paths" do G end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gem "foo", :path => "#{lib_path("foo-1.0")}" G @@ -306,7 +306,7 @@ RSpec.describe "bundle install with explicit source paths" do s.write "bar.gemspec", build_spec("bar", "1.0").first.to_ruby end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gemspec :path => "#{lib_path("foo")}" G @@ -709,8 +709,7 @@ RSpec.describe "bundle install with explicit source paths" do H end - bundle :install, - :requires => [lib_path("install_hooks.rb")] + bundle :install, :requires => [lib_path("install_hooks.rb")], :raise_on_error => false expect(err).to include("failed for foo-1.0") end diff --git a/spec/bundler/install/gemfile/ruby_spec.rb b/spec/bundler/install/gemfile/ruby_spec.rb index aab269b325..0fe93097ae 100644 --- a/spec/bundler/install/gemfile/ruby_spec.rb +++ b/spec/bundler/install/gemfile/ruby_spec.rb @@ -99,7 +99,7 @@ RSpec.describe "ruby requirement" do end it "fails gracefully with malformed requirements" do - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo1)}" ruby ">= 0", "-.\\0" gem "rack" diff --git a/spec/bundler/install/gemfile/sources_spec.rb b/spec/bundler/install/gemfile/sources_spec.rb index 639bc01647..2b43b57519 100644 --- a/spec/bundler/install/gemfile/sources_spec.rb +++ b/spec/bundler/install/gemfile/sources_spec.rb @@ -36,7 +36,7 @@ RSpec.describe "bundle install with gems on multiple sources" do end it "fails", :bundler => "3" do - bundle :install + bundle :instal, :raise_on_error => false expect(err).to include("Each source after the first must include a block") expect(exitstatus).to eq(4) if exitstatus end @@ -52,17 +52,17 @@ RSpec.describe "bundle install with gems on multiple sources" do gem "rack-obama" gem "rack", "1.0.0" # force it to install the working version in repo1 G - - bundle :install end it "warns about ambiguous gems, but installs anyway", :bundler => "2" do + bundle :install expect(err).to include("Warning: the gem 'rack' was found in multiple sources.") expect(err).to include("Installed from: #{file_uri_for(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 + bundle :install, :raise_on_error => false expect(err).to include("Each source after the first must include a block") expect(exitstatus).to eq(4) if exitstatus end @@ -246,17 +246,17 @@ RSpec.describe "bundle install with gems on multiple sources" do gem "depends_on_rack" end G - - bundle :install end it "installs from the other source and warns about ambiguous gems", :bundler => "2" do + bundle :install expect(err).to include("Warning: the gem 'rack' was found in multiple sources.") expect(err).to include("Installed from: #{file_uri_for(gem_repo2)}") expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end it "fails", :bundler => "3" do + bundle :install, :raise_on_error => false expect(err).to include("Each source after the first must include a block") expect(exitstatus).to eq(4) if exitstatus end @@ -296,7 +296,7 @@ RSpec.describe "bundle install with gems on multiple sources" do end it "fails", :bundler => "3" do - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("Each source after the first must include a block") expect(exitstatus).to eq(4) if exitstatus end @@ -356,7 +356,7 @@ RSpec.describe "bundle install with gems on multiple sources" do end it "does not find the dependency" do - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("Could not find gem 'rack', which is required by gem 'depends_on_rack', in any of the relevant sources") end end @@ -396,7 +396,7 @@ RSpec.describe "bundle install with gems on multiple sources" do end it "does not install the gem" do - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("Could not find gem 'not_in_repo1'") end end @@ -629,7 +629,7 @@ RSpec.describe "bundle install with gems on multiple sources" do build_gem "rack" end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo1)}" do gem "thin" diff --git a/spec/bundler/install/gemfile_spec.rb b/spec/bundler/install/gemfile_spec.rb index 4988bfea47..f2e520c395 100644 --- a/spec/bundler/install/gemfile_spec.rb +++ b/spec/bundler/install/gemfile_spec.rb @@ -3,7 +3,7 @@ RSpec.describe "bundle install" do context "with duplicated gems" do it "will display a warning" do - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false gem 'rails', '~> 4.0.0' gem 'rails', '~> 4.0.0' G @@ -57,7 +57,7 @@ RSpec.describe "bundle install" do gem "rack", :lib => "rack" G - bundle :install + bundle :install, :raise_on_error => false expect(err).to match(/You passed :lib as an option for gem 'rack', but it is invalid/) end end 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 diff --git a/spec/bundler/install/gemspecs_spec.rb b/spec/bundler/install/gemspecs_spec.rb index 048987af9b..98e87f1b21 100644 --- a/spec/bundler/install/gemspecs_spec.rb +++ b/spec/bundler/install/gemspecs_spec.rb @@ -109,7 +109,7 @@ RSpec.describe "bundle install" do s.required_ruby_version = "#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}" end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false ruby '#{RUBY_VERSION}', :engine_version => '#{RUBY_VERSION}', :engine => 'ruby', :patchlevel => '#{RUBY_PATCHLEVEL}' gemspec G @@ -123,7 +123,7 @@ RSpec.describe "bundle install" do s.required_ruby_version = "#{RUBY_VERSION}.#{patchlevel}" end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false ruby '#{RUBY_VERSION}', :engine_version => '#{RUBY_VERSION}', :engine => 'ruby', :patchlevel => '#{patchlevel}' gemspec G @@ -140,7 +140,7 @@ RSpec.describe "bundle install" do s.required_ruby_version = version end - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false ruby '#{version}', :engine_version => '#{version}', :engine => 'ruby' gemspec G diff --git a/spec/bundler/install/global_cache_spec.rb b/spec/bundler/install/global_cache_spec.rb index 575996718e..51fb6d7a36 100644 --- a/spec/bundler/install/global_cache_spec.rb +++ b/spec/bundler/install/global_cache_spec.rb @@ -111,7 +111,7 @@ RSpec.describe "global gem caching" do expect(source_global_cache("rack-1.0.0.gem")).to exist expect(source2_global_cache("rack-0.9.1.gem")).to exist - bundle :install, :artifice => "compact_index_no_gem" + bundle :install, :artifice => "compact_index_no_gem", :raise_on_error => false expect(err).to include("Internal Server Error 500") # rack 1.0.0 is not installed and rack 0.9.1 is not expect(the_bundle).not_to include_gems "rack 1.0.0" @@ -124,7 +124,7 @@ RSpec.describe "global gem caching" do expect(source_global_cache("rack-1.0.0.gem")).to exist expect(source2_global_cache("rack-0.9.1.gem")).to exist - bundle :install, :artifice => "compact_index_no_gem" + bundle :install, :artifice => "compact_index_no_gem", :raise_on_error => false expect(err).to include("Internal Server Error 500") # rack 0.9.1 is not installed and rack 1.0.0 is not expect(the_bundle).not_to include_gems "rack 0.9.1" diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb index 4bd9c1f5f4..45e2b46055 100644 --- a/spec/bundler/install/path_spec.rb +++ b/spec/bundler/install/path_spec.rb @@ -37,7 +37,7 @@ RSpec.describe "bundle install" do end it "disallows --path vendor/bundle --system", :bundler => "< 3" do - bundle "install --path vendor/bundle --system" + bundle "install --path vendor/bundle --system", :raise_on_error => false expect(err).to include("Please choose only one option.") expect(exitstatus).to eq(15) if exitstatus end @@ -187,7 +187,7 @@ RSpec.describe "bundle install" do vendored_gems("extensions").rmtree - run "require 'very_simple_binary_c'" + run "require 'very_simple_binary_c'", :raise_on_error => false expect(err).to include("Bundler::GemNotFound") bundle "config --local path ./vendor/bundle" @@ -211,7 +211,7 @@ RSpec.describe "bundle install" do G bundle "config --local path bundle" - bundle :install + bundle :install, :raise_on_error => false expect(err).to include("file already exists") end end diff --git a/spec/bundler/install/security_policy_spec.rb b/spec/bundler/install/security_policy_spec.rb index 28c34d9ce7..07e4e12fa6 100644 --- a/spec/bundler/install/security_policy_spec.rb +++ b/spec/bundler/install/security_policy_spec.rb @@ -16,24 +16,24 @@ RSpec.describe "policies with unsigned gems" do end it "will work after you try to deploy without a lock" do - bundle "install --deployment" + bundle "install --deployment", :raise_on_error => false bundle :install expect(exitstatus).to eq(0) if exitstatus expect(the_bundle).to include_gems "rack 1.0", "signed_gem 1.0" end it "will fail when given invalid security policy" do - bundle "install --trust-policy=InvalidPolicyName" + bundle "install --trust-policy=InvalidPolicyName", :raise_on_error => false expect(err).to include("RubyGems doesn't know about trust policy") end it "will fail with High Security setting due to presence of unsigned gem" do - bundle "install --trust-policy=HighSecurity" + bundle "install --trust-policy=HighSecurity", :raise_on_error => false expect(err).to include("security policy didn't allow") end it "will fail with Medium Security setting due to presence of unsigned gem" do - bundle "install --trust-policy=MediumSecurity" + bundle "install --trust-policy=MediumSecurity", :raise_on_error => false expect(err).to include("security policy didn't allow") end @@ -53,12 +53,12 @@ RSpec.describe "policies with signed gems and no CA" do end it "will fail with High Security setting, gem is self-signed" do - bundle "install --trust-policy=HighSecurity" + bundle "install --trust-policy=HighSecurity", :raise_on_error => false expect(err).to include("security policy didn't allow") end it "will fail with Medium Security setting, gem is self-signed" do - bundle "install --trust-policy=MediumSecurity" + bundle "install --trust-policy=MediumSecurity", :raise_on_error => false expect(err).to include("security policy didn't allow") end diff --git a/spec/bundler/install/yanked_spec.rb b/spec/bundler/install/yanked_spec.rb index 80729b3f5b..6d3065a836 100644 --- a/spec/bundler/install/yanked_spec.rb +++ b/spec/bundler/install/yanked_spec.rb @@ -22,7 +22,7 @@ RSpec.context "when installing a bundle that includes yanked gems" do L - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo4)}" gem "foo", "10.0.0" G @@ -33,7 +33,7 @@ RSpec.context "when installing a bundle that includes yanked gems" do it "throws the original error when only the Gemfile specifies a gem version that doesn't exist" do bundle "config set force_ruby_platform true" - install_gemfile <<-G + install_gemfile <<-G, :raise_on_error => false source "#{file_uri_for(gem_repo4)}" gem "foo", "10.0.0" G @@ -63,7 +63,7 @@ RSpec.context "when using gem before installing" do rack (= 0.9.1) L - bundle :list + bundle :list, :raise_on_error => false expect(err).to include("Could not find rack-0.9.1 in any of the sources") expect(err).to_not include("Your bundle is locked to rack (0.9.1), but that version could not be found in any of the sources listed in your Gemfile.") |