ruby-changes:62238
From: David <ko1@a...>
Date: Wed, 15 Jul 2020 16:05:53 +0900 (JST)
Subject: [ruby-changes:62238] 16823d4a05 (master): [rubygems/rubygems] Remove unnecessary assertions on exitstatus
https://git.ruby-lang.org/ruby.git/commit/?id=16823d4a05 From 16823d4a05580e041ff514122de5f3a3fbcef409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Wed, 24 Jun 2020 19:52:14 +0200 Subject: [rubygems/rubygems] Remove unnecessary assertions on exitstatus Since our helpers now raise by default if the subcommand fails, these will never actually fail and are not necessary. https://github.com/rubygems/rubygems/commit/6153b9321e diff --git a/spec/bundler/bundler/cli_spec.rb b/spec/bundler/bundler/cli_spec.rb index 56cb566..8ccae17 100644 --- a/spec/bundler/bundler/cli_spec.rb +++ b/spec/bundler/bundler/cli_spec.rb @@ -25,7 +25,6 @@ RSpec.describe "bundle executable" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/cli_spec.rb#L25 bundle "testtasks" end - expect(exitstatus).to be_zero if exitstatus expect(out).to eq("Hello, world") end diff --git a/spec/bundler/bundler/friendly_errors_spec.rb b/spec/bundler/bundler/friendly_errors_spec.rb index 495cbdb..d6496db 100644 --- a/spec/bundler/bundler/friendly_errors_spec.rb +++ b/spec/bundler/bundler/friendly_errors_spec.rb @@ -25,7 +25,6 @@ RSpec.describe Bundler, "friendly errors" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/friendly_errors_spec.rb#L25 bundle :install, :env => { "DEBUG" => "true" } expect(err).to include("Failed to load #{home(".gemrc")}") - expect(exitstatus).to eq(0) if exitstatus end end diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 334e8d6..b2d4593 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -8,7 +8,6 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L8 G bundle :check - expect(exitstatus).to eq(0) if exitstatus expect(out).to include("The Gemfile's dependencies are satisfied") end @@ -272,7 +271,6 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L271 it "returns success when the Gemfile is satisfied" do bundle :install bundle :check - expect(exitstatus).to eq(0) if exitstatus expect(out).to include("The Gemfile's dependencies are satisfied") end diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index f0c506a..d7124b3 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -315,7 +315,6 @@ RSpec.describe "bundle clean" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/clean_spec.rb#L315 bundle "install" bundle :clean - expect(exitstatus).to eq(0) if exitstatus end it "displays an error when used without --path" do @@ -623,7 +622,6 @@ RSpec.describe "bundle clean" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/clean_spec.rb#L622 sys_exec "foo" - expect(exitstatus).to eq(0) if exitstatus expect(out).to eq("1.0") end diff --git a/spec/bundler/commands/doctor_spec.rb b/spec/bundler/commands/doctor_spec.rb index 42e7503..d8e9674 100644 --- a/spec/bundler/commands/doctor_spec.rb +++ b/spec/bundler/commands/doctor_spec.rb @@ -24,8 +24,6 @@ RSpec.describe "bundle doctor" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/doctor_spec.rb#L24 it "succeeds on a sane installation" do bundle :doctor - - expect(exitstatus).to eq(0) end context "when all files in home are readable/writable" do diff --git a/spec/bundler/commands/help_spec.rb b/spec/bundler/commands/help_spec.rb index feb5e28..788c1b8 100644 --- a/spec/bundler/commands/help_spec.rb +++ b/spec/bundler/commands/help_spec.rb @@ -38,7 +38,6 @@ RSpec.describe "bundle help" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/help_spec.rb#L38 bundle "help testtasks" end - expect(exitstatus).to be_zero if exitstatus expect(out).to eq("--help") end diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 2a9df27..833cf3e 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -420,7 +420,6 @@ RSpec.describe "bundle install with gem sources" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/install_spec.rb#L420 gem 'foo' G - expect(exitstatus).to eq(0) if exitstatus end it "doesn't blow up when the global .bundle/config is empty" do @@ -432,7 +431,6 @@ RSpec.describe "bundle install with gem sources" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/install_spec.rb#L431 gem 'foo' G - expect(exitstatus).to eq(0) if exitstatus end end @@ -517,8 +515,6 @@ RSpec.describe "bundle install with gem sources" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/install_spec.rb#L515 end bundle :install, :dir => root_dir - - expect(exitstatus).to eq(0) if exitstatus end end diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index a144ab7..8518e49 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -73,8 +73,6 @@ RSpec.describe "bundle outdated" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/outdated_spec.rb#L73 it "returns success exit status if no outdated gems present" do bundle "outdated" - - expect(exitstatus).to be_zero if exitstatus end it "adds gem group to dependency output when repo is updated" do diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb index 81d234e..aaef839 100644 --- a/spec/bundler/install/gemfile/git_spec.rb +++ b/spec/bundler/install/gemfile/git_spec.rb @@ -912,7 +912,6 @@ RSpec.describe "bundle install with git sources" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/git_spec.rb#L912 bundle "install" bundle "install" - expect(exitstatus).to eq(0) if exitstatus end it "prints a friendly error if a file blocks the git repo" do @@ -1358,7 +1357,6 @@ In Gemfile: https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/git_spec.rb#L1357 end G - expect(exitstatus).to eq(0) if exitstatus expect(ENV["GIT_DIR"]).to eq("bar") expect(ENV["GIT_WORK_TREE"]).to eq("bar") end diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index 29cbb29..84ece3d 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -133,7 +133,6 @@ RSpec.describe "bundle install with explicit source paths" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/path_spec.rb#L133 bundle "config --local frozen true" bundle :install - expect(exitstatus).to eq(0) if exitstatus end it "installs dependencies from the path even if a newer gem is available elsewhere" do @@ -421,7 +420,6 @@ RSpec.describe "bundle install with explicit source paths" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/path_spec.rb#L420 install_gemfile <<-G gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard" G - expect(exitstatus).to eq(0) if exitstatus end context "existing lockfile" do diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb index 13b3e47..dd58aef 100644 --- a/spec/bundler/install/gemfile/platform_spec.rb +++ b/spec/bundler/install/gemfile/platform_spec.rb @@ -349,7 +349,6 @@ RSpec.describe "bundle install with platform conditionals" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/platform_spec.rb#L349 G bundle :list - expect(exitstatus).to eq(0) if exitstatus end it "does not attempt to install gems from :rbx when using --local" do diff --git a/spec/bundler/install/gemfile/ruby_spec.rb b/spec/bundler/install/gemfile/ruby_spec.rb index cdb3960..fd4300c 100644 --- a/spec/bundler/install/gemfile/ruby_spec.rb +++ b/spec/bundler/install/gemfile/ruby_spec.rb @@ -22,7 +22,6 @@ RSpec.describe "ruby requirement" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gemfile/ruby_spec.rb#L22 gem "rack-obama" G - expect(exitstatus).to eq(0) if exitstatus expect(the_bundle).to include_gems "rack-obama 1.0" end diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb index 72b2f92..18c9485 100644 --- a/spec/bundler/install/gems/compact_index_spec.rb +++ b/spec/bundler/install/gems/compact_index_spec.rb @@ -773,8 +773,6 @@ The checksum of /versions does not match the checksum provided by the server! So https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/compact_index_spec.rb#L773 G bundle :install, :artifice => "compact_index_forbidden" - - expect(exitstatus).to eq(0) if exitstatus ensure home(".gemrc").rmtree end diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb index da16ace..765b5e5 100644 --- a/spec/bundler/install/gems/dependency_api_spec.rb +++ b/spec/bundler/install/gems/dependency_api_spec.rb @@ -747,8 +747,6 @@ RSpec.describe "gemcutter's dependency API" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/dependency_api_spec.rb#L747 G bundle "install", :artifice => "endpoint_marshal_fail" - - expect(exitstatus).to eq(0) if exitstatus ensure home(".gemrc").rmtree end diff --git a/spec/bundler/install/gems/win32_spec.rb b/spec/bundler/install/gems/win32_spec.rb index 972a455..419b14f 100644 --- a/spec/bundler/install/gems/win32_spec.rb +++ b/spec/bundler/install/gems/win32_spec.rb @@ -21,6 +21,5 (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/