[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
This commit is contained in:
David Rodríguez 2020-06-24 19:52:14 +02:00 коммит произвёл Hiroshi SHIBATA
Родитель e2837a77be
Коммит 16823d4a05
21 изменённых файлов: 0 добавлений и 46 удалений

Просмотреть файл

@ -25,7 +25,6 @@ RSpec.describe "bundle executable" do
bundle "testtasks" bundle "testtasks"
end end
expect(exitstatus).to be_zero if exitstatus
expect(out).to eq("Hello, world") expect(out).to eq("Hello, world")
end end

Просмотреть файл

@ -25,7 +25,6 @@ RSpec.describe Bundler, "friendly errors" do
bundle :install, :env => { "DEBUG" => "true" } bundle :install, :env => { "DEBUG" => "true" }
expect(err).to include("Failed to load #{home(".gemrc")}") expect(err).to include("Failed to load #{home(".gemrc")}")
expect(exitstatus).to eq(0) if exitstatus
end end
end end

Просмотреть файл

@ -8,7 +8,6 @@ RSpec.describe "bundle check" do
G G
bundle :check bundle :check
expect(exitstatus).to eq(0) if exitstatus
expect(out).to include("The Gemfile's dependencies are satisfied") expect(out).to include("The Gemfile's dependencies are satisfied")
end end
@ -272,7 +271,6 @@ RSpec.describe "bundle check" do
it "returns success when the Gemfile is satisfied" do it "returns success when the Gemfile is satisfied" do
bundle :install bundle :install
bundle :check bundle :check
expect(exitstatus).to eq(0) if exitstatus
expect(out).to include("The Gemfile's dependencies are satisfied") expect(out).to include("The Gemfile's dependencies are satisfied")
end end

Просмотреть файл

@ -315,7 +315,6 @@ RSpec.describe "bundle clean" do
bundle "install" bundle "install"
bundle :clean bundle :clean
expect(exitstatus).to eq(0) if exitstatus
end end
it "displays an error when used without --path" do it "displays an error when used without --path" do
@ -623,7 +622,6 @@ RSpec.describe "bundle clean" do
sys_exec "foo" sys_exec "foo"
expect(exitstatus).to eq(0) if exitstatus
expect(out).to eq("1.0") expect(out).to eq("1.0")
end end

Просмотреть файл

@ -24,8 +24,6 @@ RSpec.describe "bundle doctor" do
it "succeeds on a sane installation" do it "succeeds on a sane installation" do
bundle :doctor bundle :doctor
expect(exitstatus).to eq(0)
end end
context "when all files in home are readable/writable" do context "when all files in home are readable/writable" do

Просмотреть файл

@ -38,7 +38,6 @@ RSpec.describe "bundle help" do
bundle "help testtasks" bundle "help testtasks"
end end
expect(exitstatus).to be_zero if exitstatus
expect(out).to eq("--help") expect(out).to eq("--help")
end end

Просмотреть файл

@ -420,7 +420,6 @@ RSpec.describe "bundle install with gem sources" do
gem 'foo' gem 'foo'
G G
expect(exitstatus).to eq(0) if exitstatus
end end
it "doesn't blow up when the global .bundle/config is empty" do 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
gem 'foo' gem 'foo'
G G
expect(exitstatus).to eq(0) if exitstatus
end end
end end
@ -517,8 +515,6 @@ RSpec.describe "bundle install with gem sources" do
end end
bundle :install, :dir => root_dir bundle :install, :dir => root_dir
expect(exitstatus).to eq(0) if exitstatus
end end
end end

Просмотреть файл

@ -73,8 +73,6 @@ RSpec.describe "bundle outdated" do
it "returns success exit status if no outdated gems present" do it "returns success exit status if no outdated gems present" do
bundle "outdated" bundle "outdated"
expect(exitstatus).to be_zero if exitstatus
end end
it "adds gem group to dependency output when repo is updated" do it "adds gem group to dependency output when repo is updated" do

Просмотреть файл

@ -912,7 +912,6 @@ RSpec.describe "bundle install with git sources" do
bundle "install" bundle "install"
bundle "install" bundle "install"
expect(exitstatus).to eq(0) if exitstatus
end end
it "prints a friendly error if a file blocks the git repo" do it "prints a friendly error if a file blocks the git repo" do
@ -1358,7 +1357,6 @@ In Gemfile:
end end
G G
expect(exitstatus).to eq(0) if exitstatus
expect(ENV["GIT_DIR"]).to eq("bar") expect(ENV["GIT_DIR"]).to eq("bar")
expect(ENV["GIT_WORK_TREE"]).to eq("bar") expect(ENV["GIT_WORK_TREE"]).to eq("bar")
end end

Просмотреть файл

@ -133,7 +133,6 @@ RSpec.describe "bundle install with explicit source paths" do
bundle "config --local frozen true" bundle "config --local frozen true"
bundle :install bundle :install
expect(exitstatus).to eq(0) if exitstatus
end end
it "installs dependencies from the path even if a newer gem is available elsewhere" do 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
install_gemfile <<-G install_gemfile <<-G
gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard" gem "bar", "1.0.0", path: "vendor/bar", require: "bar/nyard"
G G
expect(exitstatus).to eq(0) if exitstatus
end end
context "existing lockfile" do context "existing lockfile" do

Просмотреть файл

@ -349,7 +349,6 @@ RSpec.describe "bundle install with platform conditionals" do
G G
bundle :list bundle :list
expect(exitstatus).to eq(0) if exitstatus
end end
it "does not attempt to install gems from :rbx when using --local" do it "does not attempt to install gems from :rbx when using --local" do

Просмотреть файл

@ -22,7 +22,6 @@ RSpec.describe "ruby requirement" do
gem "rack-obama" gem "rack-obama"
G G
expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "rack-obama 1.0" expect(the_bundle).to include_gems "rack-obama 1.0"
end end

Просмотреть файл

@ -773,8 +773,6 @@ The checksum of /versions does not match the checksum provided by the server! So
G G
bundle :install, :artifice => "compact_index_forbidden" bundle :install, :artifice => "compact_index_forbidden"
expect(exitstatus).to eq(0) if exitstatus
ensure ensure
home(".gemrc").rmtree home(".gemrc").rmtree
end end

Просмотреть файл

@ -747,8 +747,6 @@ RSpec.describe "gemcutter's dependency API" do
G G
bundle "install", :artifice => "endpoint_marshal_fail" bundle "install", :artifice => "endpoint_marshal_fail"
expect(exitstatus).to eq(0) if exitstatus
ensure ensure
home(".gemrc").rmtree home(".gemrc").rmtree
end end

Просмотреть файл

@ -21,6 +21,5 @@ RSpec.describe "bundle install with win32-generated lockfile" do
gem "rack" gem "rack"
G G
expect(exitstatus).to eq(0) if exitstatus
end end
end end

Просмотреть файл

@ -18,7 +18,6 @@ RSpec.describe "policies with unsigned gems" do
it "will work after you try to deploy without a lock" do it "will work after you try to deploy without a lock" do
bundle "install --deployment", :raise_on_error => false bundle "install --deployment", :raise_on_error => false
bundle :install bundle :install
expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "rack 1.0", "signed_gem 1.0" expect(the_bundle).to include_gems "rack 1.0", "signed_gem 1.0"
end end
@ -39,7 +38,6 @@ RSpec.describe "policies with unsigned gems" do
it "will succeed with no policy" do it "will succeed with no policy" do
bundle "install" bundle "install"
expect(exitstatus).to eq(0) if exitstatus
end end
end end
@ -64,13 +62,11 @@ RSpec.describe "policies with signed gems and no CA" do
it "will succeed with Low Security setting, low security accepts self signed gem" do it "will succeed with Low Security setting, low security accepts self signed gem" do
bundle "install --trust-policy=LowSecurity" bundle "install --trust-policy=LowSecurity"
expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "signed_gem 1.0" expect(the_bundle).to include_gems "signed_gem 1.0"
end end
it "will succeed with no policy" do it "will succeed with no policy" do
bundle "install" bundle "install"
expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "signed_gem 1.0" expect(the_bundle).to include_gems "signed_gem 1.0"
end end
end end

Просмотреть файл

@ -387,7 +387,6 @@ G
G G
bundle :check bundle :check
expect(exitstatus).to eq(0) if exitstatus
expect(out).to match(/\AResolving dependencies\.\.\.\.*\nThe Gemfile's dependencies are satisfied\z/) expect(out).to match(/\AResolving dependencies\.\.\.\.*\nThe Gemfile's dependencies are satisfied\z/)
end end
@ -405,7 +404,6 @@ G
G G
bundle :check bundle :check
expect(exitstatus).to eq(0) if exitstatus
expect(out).to match(/\AResolving dependencies\.\.\.\.*\nThe Gemfile's dependencies are satisfied\z/) expect(out).to match(/\AResolving dependencies\.\.\.\.*\nThe Gemfile's dependencies are satisfied\z/)
end end

Просмотреть файл

@ -163,7 +163,6 @@ RSpec.describe "Running bin/* commands" do
# run binstub for non default Gemfile # run binstub for non default Gemfile
gembin "foo" gembin "foo"
expect(exitstatus).to eq(0) if exitstatus
expect(out).to eq("1.0") expect(out).to eq("1.0")
end end
end end

Просмотреть файл

@ -41,7 +41,6 @@ RSpec.describe "require 'bundler/gem_tasks'" do
] ]
tasks = out.lines.to_a.map {|s| s.split("#").first.strip } tasks = out.lines.to_a.map {|s| s.split("#").first.strip }
expect(tasks & expected_tasks).to eq(expected_tasks) expect(tasks & expected_tasks).to eq(expected_tasks)
expect(exitstatus).to eq(0) if exitstatus
end end
it "defines a working `rake install` task", :ruby_repo do it "defines a working `rake install` task", :ruby_repo do

Просмотреть файл

@ -57,7 +57,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(out).to eq("two") expect(out).to eq("two")
expect(exitstatus).to be_zero if exitstatus
script <<-RUBY, :raise_on_error => false script <<-RUBY, :raise_on_error => false
gemfile do gemfile do
@ -80,7 +79,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(out).to include("Rack's post install message") expect(out).to include("Rack's post install message")
expect(exitstatus).to be_zero if exitstatus
script <<-RUBY, :artifice => "endpoint" script <<-RUBY, :artifice => "endpoint"
gemfile(true) do gemfile(true) do
@ -93,7 +91,6 @@ RSpec.describe "bundler/inline#gemfile" do
err_lines = err.split("\n") err_lines = err.split("\n")
err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } unless RUBY_VERSION < "2.7" err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } unless RUBY_VERSION < "2.7"
expect(err_lines).to be_empty expect(err_lines).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "lets me use my own ui object" do it "lets me use my own ui object" do
@ -113,7 +110,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(out).to eq("CONFIRMED!\nCONFIRMED!") expect(out).to eq("CONFIRMED!\nCONFIRMED!")
expect(exitstatus).to be_zero if exitstatus
end end
it "has an option for quiet installation" do it "has an option for quiet installation" do
@ -155,7 +151,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(out).to match("OKAY") expect(out).to match("OKAY")
expect(exitstatus).to be_zero if exitstatus
end end
it "installs quietly if necessary when the install option is not set" do it "installs quietly if necessary when the install option is not set" do
@ -170,7 +165,6 @@ RSpec.describe "bundler/inline#gemfile" do
expect(out).to eq("1.0.0") expect(out).to eq("1.0.0")
expect(err).to be_empty expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "installs quietly from git if necessary when the install option is not set" do it "installs quietly from git if necessary when the install option is not set" do
@ -188,7 +182,6 @@ RSpec.describe "bundler/inline#gemfile" do
expect(out).to eq("1.0.0\n2.0.0") expect(out).to eq("1.0.0\n2.0.0")
expect(err).to be_empty expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "allows calling gemfile twice" do it "allows calling gemfile twice" do
@ -208,7 +201,6 @@ RSpec.describe "bundler/inline#gemfile" do
expect(out).to eq("two\nfour") expect(out).to eq("two\nfour")
expect(err).to be_empty expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "installs inline gems when a Gemfile.lock is present" do it "installs inline gems when a Gemfile.lock is present" do
@ -243,7 +235,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(err).to be_empty expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "installs inline gems when frozen is set" do it "installs inline gems when frozen is set" do
@ -257,7 +248,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(last_command.stderr).to be_empty expect(last_command.stderr).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "installs inline gems when BUNDLE_GEMFILE is set to an empty string" do it "installs inline gems when BUNDLE_GEMFILE is set to an empty string" do
@ -273,7 +263,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(err).to be_empty expect(err).to be_empty
expect(exitstatus).to be_zero if exitstatus
end end
it "installs inline gems when BUNDLE_BIN is set" do it "installs inline gems when BUNDLE_BIN is set" do

Просмотреть файл

@ -112,7 +112,6 @@ RSpec.describe "bundle update" do
G G
bundle "update", :all => true bundle "update", :all => true
expect(exitstatus).to eq(0) if exitstatus
end end
describe "with submodules" do describe "with submodules" do