diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-06-03 18:43:17 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-18 19:14:15 +0900 |
commit | 61b6f53337cb71b35c56d480ec6044ba7e85cb71 (patch) | |
tree | 02cb7fb6e175c9114a87bee50551334a2f7358fb /spec/bundler/install/gemfile | |
parent | 529a9e8a1f804332461a8519fe46dd78f3cb4265 (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/gemfile')
-rw-r--r-- | spec/bundler/install/gemfile/gemspec_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/git_spec.rb | 33 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/groups_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/path_spec.rb | 9 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/ruby_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/install/gemfile/sources_spec.rb | 18 |
6 files changed, 36 insertions, 38 deletions
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" |