summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-06-24 19:52:14 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-07-15 16:05:12 +0900
commit16823d4a05580e041ff514122de5f3a3fbcef409 (patch)
tree56b01b2c04e7b89e4e7437db1e4abcc9ad7fde94 /spec
parente2837a77be2164fa17be046eabb93cbb63f77311 (diff)
[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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3275
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/cli_spec.rb1
-rw-r--r--spec/bundler/bundler/friendly_errors_spec.rb1
-rw-r--r--spec/bundler/commands/check_spec.rb2
-rw-r--r--spec/bundler/commands/clean_spec.rb2
-rw-r--r--spec/bundler/commands/doctor_spec.rb2
-rw-r--r--spec/bundler/commands/help_spec.rb1
-rw-r--r--spec/bundler/commands/install_spec.rb4
-rw-r--r--spec/bundler/commands/outdated_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/git_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb2
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb1
-rw-r--r--spec/bundler/install/gemfile/ruby_spec.rb1
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb2
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb2
-rw-r--r--spec/bundler/install/gems/win32_spec.rb1
-rw-r--r--spec/bundler/install/security_policy_spec.rb4
-rw-r--r--spec/bundler/other/platform_spec.rb2
-rw-r--r--spec/bundler/runtime/executable_spec.rb1
-rw-r--r--spec/bundler/runtime/gem_tasks_spec.rb1
-rw-r--r--spec/bundler/runtime/inline_spec.rb11
-rw-r--r--spec/bundler/update/git_spec.rb1
21 files changed, 0 insertions, 46 deletions
diff --git a/spec/bundler/bundler/cli_spec.rb b/spec/bundler/bundler/cli_spec.rb
index 56cb56609b..8ccae17fe0 100644
--- a/spec/bundler/bundler/cli_spec.rb
+++ b/spec/bundler/bundler/cli_spec.rb
@@ -25,7 +25,6 @@ RSpec.describe "bundle executable" do
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 495cbdbe49..d6496db6ae 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
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 334e8d6992..b2d459368e 100644
--- a/spec/bundler/commands/check_spec.rb
+++ b/spec/bundler/commands/check_spec.rb
@@ -8,7 +8,6 @@ RSpec.describe "bundle check" do
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
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 f0c506aa04..d7124b398d 100644
--- a/spec/bundler/commands/clean_spec.rb
+++ b/spec/bundler/commands/clean_spec.rb
@@ -315,7 +315,6 @@ RSpec.describe "bundle clean" do
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
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 42e7503356..d8e9674a24 100644
--- a/spec/bundler/commands/doctor_spec.rb
+++ b/spec/bundler/commands/doctor_spec.rb
@@ -24,8 +24,6 @@ RSpec.describe "bundle doctor" do
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 feb5e283ea..788c1b8d29 100644
--- a/spec/bundler/commands/help_spec.rb
+++ b/spec/bundler/commands/help_spec.rb
@@ -38,7 +38,6 @@ RSpec.describe "bundle help" do
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 2a9df27dd2..833cf3e02f 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
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
gem 'foo'
G
- expect(exitstatus).to eq(0) if exitstatus
end
end
@@ -517,8 +515,6 @@ RSpec.describe "bundle install with gem sources" do
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 a144ab7149..8518e49e82 100644
--- a/spec/bundler/commands/outdated_spec.rb
+++ b/spec/bundler/commands/outdated_spec.rb
@@ -73,8 +73,6 @@ RSpec.describe "bundle outdated" do
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 81d234e101..aaef839c0a 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
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:
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 29cbb291a4..84ece3d699 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
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
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 13b3e47163..dd58aef29b 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
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 cdb3960089..fd4300c042 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
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 72b2f925d1..18c9485c3c 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
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 da16ace767..765b5e5195 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
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 972a455bee..419b14ff0f 100644
--- a/spec/bundler/install/gems/win32_spec.rb
+++ b/spec/bundler/install/gems/win32_spec.rb
@@ -21,6 +21,5 @@ RSpec.describe "bundle install with win32-generated lockfile" do
gem "rack"
G
- expect(exitstatus).to eq(0) if exitstatus
end
end
diff --git a/spec/bundler/install/security_policy_spec.rb b/spec/bundler/install/security_policy_spec.rb
index 07e4e12fa6..43c3069c4e 100644
--- a/spec/bundler/install/security_policy_spec.rb
+++ b/spec/bundler/install/security_policy_spec.rb
@@ -18,7 +18,6 @@ RSpec.describe "policies with unsigned gems" do
it "will work after you try to deploy without a lock" do
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
@@ -39,7 +38,6 @@ RSpec.describe "policies with unsigned gems" do
it "will succeed with no policy" do
bundle "install"
- expect(exitstatus).to eq(0) if exitstatus
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
bundle "install --trust-policy=LowSecurity"
- expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "signed_gem 1.0"
end
it "will succeed with no policy" do
bundle "install"
- expect(exitstatus).to eq(0) if exitstatus
expect(the_bundle).to include_gems "signed_gem 1.0"
end
end
diff --git a/spec/bundler/other/platform_spec.rb b/spec/bundler/other/platform_spec.rb
index 48beefe585..0ad17a2722 100644
--- a/spec/bundler/other/platform_spec.rb
+++ b/spec/bundler/other/platform_spec.rb
@@ -387,7 +387,6 @@ G
G
bundle :check
- expect(exitstatus).to eq(0) if exitstatus
expect(out).to match(/\AResolving dependencies\.\.\.\.*\nThe Gemfile's dependencies are satisfied\z/)
end
@@ -405,7 +404,6 @@ G
G
bundle :check
- expect(exitstatus).to eq(0) if exitstatus
expect(out).to match(/\AResolving dependencies\.\.\.\.*\nThe Gemfile's dependencies are satisfied\z/)
end
diff --git a/spec/bundler/runtime/executable_spec.rb b/spec/bundler/runtime/executable_spec.rb
index 0f0226fb97..e39338e425 100644
--- a/spec/bundler/runtime/executable_spec.rb
+++ b/spec/bundler/runtime/executable_spec.rb
@@ -163,7 +163,6 @@ RSpec.describe "Running bin/* commands" do
# run binstub for non default Gemfile
gembin "foo"
- expect(exitstatus).to eq(0) if exitstatus
expect(out).to eq("1.0")
end
end
diff --git a/spec/bundler/runtime/gem_tasks_spec.rb b/spec/bundler/runtime/gem_tasks_spec.rb
index 53515c0d2e..b2f9ae725e 100644
--- a/spec/bundler/runtime/gem_tasks_spec.rb
+++ b/spec/bundler/runtime/gem_tasks_spec.rb
@@ -41,7 +41,6 @@ RSpec.describe "require 'bundler/gem_tasks'" do
]
tasks = out.lines.to_a.map {|s| s.split("#").first.strip }
expect(tasks & expected_tasks).to eq(expected_tasks)
- expect(exitstatus).to eq(0) if exitstatus
end
it "defines a working `rake install` task", :ruby_repo do
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb
index 4e76c2dfb0..86ac3f4bb6 100644
--- a/spec/bundler/runtime/inline_spec.rb
+++ b/spec/bundler/runtime/inline_spec.rb
@@ -57,7 +57,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(out).to eq("two")
- expect(exitstatus).to be_zero if exitstatus
script <<-RUBY, :raise_on_error => false
gemfile do
@@ -80,7 +79,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(out).to include("Rack's post install message")
- expect(exitstatus).to be_zero if exitstatus
script <<-RUBY, :artifice => "endpoint"
gemfile(true) do
@@ -93,7 +91,6 @@ RSpec.describe "bundler/inline#gemfile" do
err_lines = err.split("\n")
err_lines.reject!{|line| line =~ /\.rb:\d+: warning: / } unless RUBY_VERSION < "2.7"
expect(err_lines).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
it "lets me use my own ui object" do
@@ -113,7 +110,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(out).to eq("CONFIRMED!\nCONFIRMED!")
- expect(exitstatus).to be_zero if exitstatus
end
it "has an option for quiet installation" do
@@ -155,7 +151,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(out).to match("OKAY")
- expect(exitstatus).to be_zero if exitstatus
end
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(err).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
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(err).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
it "allows calling gemfile twice" do
@@ -208,7 +201,6 @@ RSpec.describe "bundler/inline#gemfile" do
expect(out).to eq("two\nfour")
expect(err).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
it "installs inline gems when a Gemfile.lock is present" do
@@ -243,7 +235,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(err).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
it "installs inline gems when frozen is set" do
@@ -257,7 +248,6 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY
expect(last_command.stderr).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
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
expect(err).to be_empty
- expect(exitstatus).to be_zero if exitstatus
end
it "installs inline gems when BUNDLE_BIN is set" do
diff --git a/spec/bundler/update/git_spec.rb b/spec/bundler/update/git_spec.rb
index 8d42c2fcc3..bf078fa576 100644
--- a/spec/bundler/update/git_spec.rb
+++ b/spec/bundler/update/git_spec.rb
@@ -112,7 +112,6 @@ RSpec.describe "bundle update" do
G
bundle "update", :all => true
- expect(exitstatus).to eq(0) if exitstatus
end
describe "with submodules" do