ruby-changes:62235
From: David <ko1@a...>
Date: Wed, 15 Jul 2020 16:05:52 +0900 (JST)
Subject: [ruby-changes:62235] 2fafc08aa3 (master): [rubygems/rubygems] Remove unneeded trailing conditions on exitstatus
https://git.ruby-lang.org/ruby.git/commit/?id=2fafc08aa3 From 2fafc08aa34ddba39d0bfdb6e7c5de4f7bf7f55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Wed, 24 Jun 2020 19:53:16 +0200 Subject: [rubygems/rubygems] Remove unneeded trailing conditions on exitstatus https://github.com/rubygems/rubygems/commit/27e0e4ecb6 diff --git a/spec/bundler/bundler/cli_spec.rb b/spec/bundler/bundler/cli_spec.rb index 8ccae17..50e2a69 100644 --- a/spec/bundler/bundler/cli_spec.rb +++ b/spec/bundler/bundler/cli_spec.rb @@ -5,12 +5,12 @@ require "bundler/cli" https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/cli_spec.rb#L5 RSpec.describe "bundle executable" do it "returns non-zero exit status when passed unrecognized options" do bundle "--invalid_argument", :raise_on_error => false - expect(exitstatus).to_not be_zero if exitstatus + expect(exitstatus).to_not be_zero end it "returns non-zero exit status when passed unrecognized task" do bundle "unrecognized-task", :raise_on_error => false - expect(exitstatus).to_not be_zero if exitstatus + expect(exitstatus).to_not be_zero end it "looks for a binary and executes it if it's named bundler-<task>" do diff --git a/spec/bundler/cache/gems_spec.rb b/spec/bundler/cache/gems_spec.rb index 8d74708..2b5ba73 100644 --- a/spec/bundler/cache/gems_spec.rb +++ b/spec/bundler/cache/gems_spec.rb @@ -138,7 +138,7 @@ RSpec.describe "bundle cache" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/gems_spec.rb#L138 G bundle :cache, :raise_on_error => false - expect(exitstatus).to_not eq(0) if exitstatus + expect(exitstatus).to_not eq(0) expect(err).to include("builtin_gem-1.0.2 is built in to Ruby, and can't be cached") end end diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 2af5839..632c521 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -58,7 +58,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L58 G bundle "binstubs", :raise_on_error => false - expect(exitstatus).to eq(1) if exitstatus + expect(exitstatus).to eq(1) expect(err).to include("`bundle binstubs` needs at least one gem to run.") end @@ -123,7 +123,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L123 context "when BUNDLER_VERSION is set" do it "runs the correct version of bundler" do sys_exec "bin/bundle install", :env => { "BUNDLER_VERSION" => "999.999.999" }, :raise_on_error => false - expect(exitstatus).to eq(42) if exitstatus + expect(exitstatus).to eq(42) expect(err).to include("Activating bundler (~> 999.999) failed:"). and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`") end @@ -137,7 +137,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L137 it "runs the correct version of bundler" do sys_exec "bin/bundle install", :raise_on_error => false - expect(exitstatus).to eq(42) if exitstatus + expect(exitstatus).to eq(42) expect(err).to include("Activating bundler (~> 999.999) failed:"). and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`") end @@ -152,7 +152,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L152 it "runs the correct version of bundler" do sys_exec "bin/bundle install", :raise_on_error => false - expect(exitstatus).to eq(42) if exitstatus + expect(exitstatus).to eq(42) expect(err).to include("Activating bundler (~> 44.0) failed:"). and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 44.0'`") end @@ -167,7 +167,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L167 it "runs the available version of bundler when the version is older and the same major" do sys_exec "bin/bundle install" - expect(exitstatus).not_to eq(42) if exitstatus + expect(exitstatus).not_to eq(42) expect(err).not_to include("Activating bundler (~> 55.0) failed:") end end @@ -181,7 +181,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L181 it "runs the correct version of bundler when the version is a pre-release" do sys_exec "bin/bundle install", :raise_on_error => false - expect(exitstatus).to eq(42) if exitstatus + expect(exitstatus).to eq(42) expect(err).to include("Activating bundler (~> 2.12.a) failed:"). and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 2.12.a'`") end @@ -198,7 +198,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L198 it "calls through to the explicit bundler version" do sys_exec "bin/bundle update --bundler=999.999.999", :raise_on_error => false - expect(exitstatus).to eq(42) if exitstatus + expect(exitstatus).to eq(42) expect(err).to include("Activating bundler (~> 999.999) failed:"). and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`") end @@ -223,7 +223,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L223 it "attempts to load that version" do sys_exec bundled_app("bin/rackup").to_s, :raise_on_error => false - expect(exitstatus).to eq(42) if exitstatus + expect(exitstatus).to eq(42) expect(err).to include("Activating bundler (~> 999.999) failed:"). and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`") end @@ -297,7 +297,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L297 bundle "binstubs doesnt_exist", :raise_on_error => false - expect(exitstatus).to eq(7) if exitstatus + expect(exitstatus).to eq(7) expect(err).to include("Could not find gem 'doesnt_exist'.") end end diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index cbad2ce..173389c 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -266,7 +266,7 @@ RSpec.describe "bundle cache" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/cache_spec.rb#L266 gem "rack-obama" G subject - expect(exitstatus).to eq(16) if exitstatus + expect(exitstatus).to eq(16) expect(err).to include("deployment mode") expect(err).to include("You have added to the Gemfile") expect(err).to include("* rack-obama") diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index b2d4593..dd69172 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -66,7 +66,7 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L66 G bundle :check, :raise_on_error => false - expect(exitstatus).to be > 0 if exitstatus + expect(exitstatus).to be > 0 expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.") end @@ -128,7 +128,7 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L128 bundle "check", :raise_on_error => false expect(err).to include("* rack (1.0.0)") - expect(exitstatus).to eq(1) if exitstatus + expect(exitstatus).to eq(1) end it "ignores missing gems restricted to other platforms" do @@ -195,13 +195,13 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L195 it "outputs an error when the default Gemfile is not found" do bundle :check, :raise_on_error => false - expect(exitstatus).to eq(10) if exitstatus + expect(exitstatus).to eq(10) expect(err).to include("Could not locate Gemfile") end it "does not output fatal error message" do bundle :check, :raise_on_error => false - expect(exitstatus).to eq(10) if exitstatus + expect(exitstatus).to eq(10) expect(err).not_to include("Unfortunately, a fatal error has occurred. ") end @@ -253,7 +253,7 @@ RSpec.describe "bundle check" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/check_spec.rb#L253 end it "returns false" do - expect(exitstatus).to eq(1) if exitstatus + expect(exitstatus).to eq(1) expect(err).to match(/The following gems are missing/) end end diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index d7124b3..0ecdf23 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -327,7 +327,7 @@ RSpec.describe "bundle clean" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/clean_spec.rb#L327 bundle :clean, :raise_on_error => false - expect(exitstatus).to eq(15) if exitstatus + expect(exitstatus).to eq(15) expect(err) (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/