1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Remove unneeded trailing conditions on exitstatus

https://github.com/rubygems/rubygems/commit/27e0e4ecb6
This commit is contained in:
David Rodríguez 2020-06-24 19:53:16 +02:00 committed by Hiroshi SHIBATA
parent 547ba6608e
commit 2fafc08aa3
Notes: git 2020-07-15 16:05:48 +09:00
20 changed files with 52 additions and 52 deletions

View file

@ -5,12 +5,12 @@ require "bundler/cli"
RSpec.describe "bundle executable" do RSpec.describe "bundle executable" do
it "returns non-zero exit status when passed unrecognized options" do it "returns non-zero exit status when passed unrecognized options" do
bundle "--invalid_argument", :raise_on_error => false bundle "--invalid_argument", :raise_on_error => false
expect(exitstatus).to_not be_zero if exitstatus expect(exitstatus).to_not be_zero
end end
it "returns non-zero exit status when passed unrecognized task" do it "returns non-zero exit status when passed unrecognized task" do
bundle "unrecognized-task", :raise_on_error => false bundle "unrecognized-task", :raise_on_error => false
expect(exitstatus).to_not be_zero if exitstatus expect(exitstatus).to_not be_zero
end end
it "looks for a binary and executes it if it's named bundler-<task>" do it "looks for a binary and executes it if it's named bundler-<task>" do

View file

@ -138,7 +138,7 @@ RSpec.describe "bundle cache" do
G G
bundle :cache, :raise_on_error => false 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") expect(err).to include("builtin_gem-1.0.2 is built in to Ruby, and can't be cached")
end end
end end

View file

@ -58,7 +58,7 @@ RSpec.describe "bundle binstubs <gem>" do
G G
bundle "binstubs", :raise_on_error => false 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.") expect(err).to include("`bundle binstubs` needs at least one gem to run.")
end end
@ -123,7 +123,7 @@ RSpec.describe "bundle binstubs <gem>" do
context "when BUNDLER_VERSION is set" do context "when BUNDLER_VERSION is set" do
it "runs the correct version of bundler" do it "runs the correct version of bundler" do
sys_exec "bin/bundle install", :env => { "BUNDLER_VERSION" => "999.999.999" }, :raise_on_error => false 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:"). 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'`") and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`")
end end
@ -137,7 +137,7 @@ RSpec.describe "bundle binstubs <gem>" do
it "runs the correct version of bundler" do it "runs the correct version of bundler" do
sys_exec "bin/bundle install", :raise_on_error => false 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:"). 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'`") and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`")
end end
@ -152,7 +152,7 @@ RSpec.describe "bundle binstubs <gem>" do
it "runs the correct version of bundler" do it "runs the correct version of bundler" do
sys_exec "bin/bundle install", :raise_on_error => false 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:"). 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'`") and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 44.0'`")
end end
@ -167,7 +167,7 @@ RSpec.describe "bundle binstubs <gem>" do
it "runs the available version of bundler when the version is older and the same major" do it "runs the available version of bundler when the version is older and the same major" do
sys_exec "bin/bundle install" 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:") expect(err).not_to include("Activating bundler (~> 55.0) failed:")
end end
end end
@ -181,7 +181,7 @@ RSpec.describe "bundle binstubs <gem>" do
it "runs the correct version of bundler when the version is a pre-release" do it "runs the correct version of bundler when the version is a pre-release" do
sys_exec "bin/bundle install", :raise_on_error => false 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:"). 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'`") and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 2.12.a'`")
end end
@ -198,7 +198,7 @@ RSpec.describe "bundle binstubs <gem>" do
it "calls through to the explicit bundler version" do it "calls through to the explicit bundler version" do
sys_exec "bin/bundle update --bundler=999.999.999", :raise_on_error => false 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:"). 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'`") and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`")
end end
@ -223,7 +223,7 @@ RSpec.describe "bundle binstubs <gem>" do
it "attempts to load that version" do it "attempts to load that version" do
sys_exec bundled_app("bin/rackup").to_s, :raise_on_error => false 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:"). 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'`") and include("To install the version of bundler this project requires, run `gem install bundler -v '~> 999.999'`")
end end
@ -297,7 +297,7 @@ RSpec.describe "bundle binstubs <gem>" do
bundle "binstubs doesnt_exist", :raise_on_error => false 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'.") expect(err).to include("Could not find gem 'doesnt_exist'.")
end end
end end

View file

@ -266,7 +266,7 @@ RSpec.describe "bundle cache" do
gem "rack-obama" gem "rack-obama"
G G
subject subject
expect(exitstatus).to eq(16) if exitstatus expect(exitstatus).to eq(16)
expect(err).to include("deployment mode") expect(err).to include("deployment mode")
expect(err).to include("You have added to the Gemfile") expect(err).to include("You have added to the Gemfile")
expect(err).to include("* rack-obama") expect(err).to include("* rack-obama")

View file

@ -66,7 +66,7 @@ RSpec.describe "bundle check" do
G G
bundle :check, :raise_on_error => false 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.") expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
end end
@ -128,7 +128,7 @@ RSpec.describe "bundle check" do
bundle "check", :raise_on_error => false bundle "check", :raise_on_error => false
expect(err).to include("* rack (1.0.0)") expect(err).to include("* rack (1.0.0)")
expect(exitstatus).to eq(1) if exitstatus expect(exitstatus).to eq(1)
end end
it "ignores missing gems restricted to other platforms" do it "ignores missing gems restricted to other platforms" do
@ -195,13 +195,13 @@ RSpec.describe "bundle check" do
it "outputs an error when the default Gemfile is not found" do it "outputs an error when the default Gemfile is not found" do
bundle :check, :raise_on_error => false 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") expect(err).to include("Could not locate Gemfile")
end end
it "does not output fatal error message" do it "does not output fatal error message" do
bundle :check, :raise_on_error => false 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. ") expect(err).not_to include("Unfortunately, a fatal error has occurred. ")
end end
@ -253,7 +253,7 @@ RSpec.describe "bundle check" do
end end
it "returns false" do 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/) expect(err).to match(/The following gems are missing/)
end end
end end

View file

@ -327,7 +327,7 @@ RSpec.describe "bundle clean" do
bundle :clean, :raise_on_error => false bundle :clean, :raise_on_error => false
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15)
expect(err).to include("--force") expect(err).to include("--force")
end end

View file

@ -327,7 +327,7 @@ RSpec.describe "bundle exec" do
G G
bundle "exec foobarbaz", :raise_on_error => false bundle "exec foobarbaz", :raise_on_error => false
expect(exitstatus).to eq(127) if exitstatus expect(exitstatus).to eq(127)
expect(err).to include("bundler: command not found: foobarbaz") expect(err).to include("bundler: command not found: foobarbaz")
expect(err).to include("Install missing gem executables with `bundle install`") expect(err).to include("Install missing gem executables with `bundle install`")
end end
@ -339,7 +339,7 @@ RSpec.describe "bundle exec" do
bundle "exec touch foo" bundle "exec touch foo"
bundle "exec ./foo", :raise_on_error => false bundle "exec ./foo", :raise_on_error => false
expect(exitstatus).to eq(126) if exitstatus expect(exitstatus).to eq(126)
expect(err).to include("bundler: not executable: ./foo") expect(err).to include("bundler: not executable: ./foo")
end end
@ -349,7 +349,7 @@ RSpec.describe "bundle exec" do
G G
bundle "exec", :raise_on_error => false bundle "exec", :raise_on_error => false
expect(exitstatus).to eq(128) if exitstatus expect(exitstatus).to eq(128)
expect(err).to include("bundler: exec needs a command to run") expect(err).to include("bundler: exec needs a command to run")
end end
@ -647,7 +647,7 @@ RSpec.describe "bundle exec" do
skip "https://github.com/rubygems/bundler/issues/6898" if Gem.win_platform? skip "https://github.com/rubygems/bundler/issues/6898" if Gem.win_platform?
subject subject
expect(exitstatus).to eq(exit_code) if exitstatus expect(exitstatus).to eq(exit_code)
expect(err).to eq(expected_err) expect(err).to eq(expected_err)
expect(out).to eq(expected) expect(out).to eq(expected)
end end

View file

@ -119,7 +119,7 @@ RSpec.describe "bundle install with gem sources" do
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem :rack gem :rack
G G
expect(exitstatus).to eq(4) if exitstatus expect(exitstatus).to eq(4)
end end
it "pulls in dependencies" do it "pulls in dependencies" do
@ -578,7 +578,7 @@ RSpec.describe "bundle install with gem sources" do
it "should display a helpful message explaining how to fix it" do it "should display a helpful message explaining how to fix it" do
bundle :install, :env => { "BUNDLE_RUBYGEMS__ORG" => "user:pass{word" }, :raise_on_error => false bundle :install, :env => { "BUNDLE_RUBYGEMS__ORG" => "user:pass{word" }, :raise_on_error => false
expect(exitstatus).to eq(17) if exitstatus expect(exitstatus).to eq(17)
expect(err).to eq("Please CGI escape your usernames and passwords before " \ expect(err).to eq("Please CGI escape your usernames and passwords before " \
"setting them for authentication.") "setting them for authentication.")
end end

View file

@ -1055,7 +1055,7 @@ Usage: "bundle gem NAME [OPTIONS]"
FileUtils.touch(bundled_app("conflict-foobar")) FileUtils.touch(bundled_app("conflict-foobar"))
bundle "gem conflict-foobar", :raise_on_error => false bundle "gem conflict-foobar", :raise_on_error => false
expect(err).to include("Errno::ENOTDIR") expect(err).to include("Errno::ENOTDIR")
expect(exitstatus).to eql(32) if exitstatus expect(exitstatus).to eql(32)
end end
end end

View file

@ -68,7 +68,7 @@ RSpec.describe "bundle outdated" do
bundle "outdated", :raise_on_error => false bundle "outdated", :raise_on_error => false
expect(exitstatus).to_not be_zero if exitstatus expect(exitstatus).to_not be_zero
end end
it "returns success exit status if no outdated gems present" do it "returns success exit status if no outdated gems present" do
@ -517,7 +517,7 @@ RSpec.describe "bundle outdated" do
it "returns non-zero exit code" do it "returns non-zero exit code" do
bundle "outdated invalid_gem_name", :raise_on_error => false bundle "outdated invalid_gem_name", :raise_on_error => false
expect(exitstatus).to_not be_zero if exitstatus expect(exitstatus).to_not be_zero
end end
end end

View file

@ -701,7 +701,7 @@ RSpec.describe "bundle update" do
bundle "update nonexisting", :raise_on_error => false bundle "update nonexisting", :raise_on_error => false
expect(err).to include("This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.") expect(err).to include("This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.")
expect(exitstatus).to eq(22) if exitstatus expect(exitstatus).to eq(22)
end end
end end

View file

@ -23,7 +23,7 @@ RSpec.describe "install in deployment or frozen mode" do
bundle "install --deployment --system", :raise_on_error => false bundle "install --deployment --system", :raise_on_error => false
expect(err).to include("You have specified both --deployment") expect(err).to include("You have specified both --deployment")
expect(err).to include("Please choose only one option") expect(err).to include("Please choose only one option")
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15)
end end
it "disallows --deployment --path --system" do it "disallows --deployment --path --system" do
@ -31,7 +31,7 @@ RSpec.describe "install in deployment or frozen mode" do
expect(err).to include("You have specified both --path") expect(err).to include("You have specified both --path")
expect(err).to include("as well as --system") expect(err).to include("as well as --system")
expect(err).to include("Please choose only one option") expect(err).to include("Please choose only one option")
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15)
end end
it "doesn't mess up a subsequent `bundle install` after you try to deploy without a lock" do it "doesn't mess up a subsequent `bundle install` after you try to deploy without a lock" do

View file

@ -926,7 +926,7 @@ RSpec.describe "bundle install with git sources" do
gem "foo", :git => "#{lib_path("foo-1.0")}" gem "foo", :git => "#{lib_path("foo-1.0")}"
G G
expect(exitstatus).to_not eq(0) if exitstatus expect(exitstatus).to_not eq(0)
expect(err).to include("Bundler could not install a gem because it " \ expect(err).to include("Bundler could not install a gem because it " \
"needs to create a directory, but a file exists " \ "needs to create a directory, but a file exists " \
"- #{default_bundle_path("bundler")}") "- #{default_bundle_path("bundler")}")

View file

@ -309,7 +309,7 @@ RSpec.describe "bundle install with explicit source paths" do
gemspec :path => "#{lib_path("foo")}" gemspec :path => "#{lib_path("foo")}"
G G
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15)
expect(err).to match(/There are multiple gemspecs/) expect(err).to match(/There are multiple gemspecs/)
end end

View file

@ -38,7 +38,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "fails", :bundler => "3" do it "fails", :bundler => "3" do
bundle :instal, :raise_on_error => false bundle :instal, :raise_on_error => false
expect(err).to include("Each source after the first must include a block") expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4) if exitstatus expect(exitstatus).to eq(4)
end end
end end
@ -64,7 +64,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "fails", :bundler => "3" do it "fails", :bundler => "3" do
bundle :install, :raise_on_error => false bundle :install, :raise_on_error => false
expect(err).to include("Each source after the first must include a block") expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4) if exitstatus expect(exitstatus).to eq(4)
end end
end end
end end
@ -258,7 +258,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "fails", :bundler => "3" do it "fails", :bundler => "3" do
bundle :install, :raise_on_error => false bundle :install, :raise_on_error => false
expect(err).to include("Each source after the first must include a block") expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4) if exitstatus expect(exitstatus).to eq(4)
end end
end end
@ -298,7 +298,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
it "fails", :bundler => "3" do it "fails", :bundler => "3" do
bundle :install, :raise_on_error => false bundle :install, :raise_on_error => false
expect(err).to include("Each source after the first must include a block") expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4) if exitstatus expect(exitstatus).to eq(4)
end end
end end
end end

View file

@ -856,7 +856,7 @@ The checksum of /versions does not match the checksum provided by the server! So
source "htps://rubygems.org" source "htps://rubygems.org"
gem "rack" gem "rack"
G G
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15)
expect(err).to end_with(<<-E.strip) expect(err).to end_with(<<-E.strip)
The request uri `htps://index.rubygems.org/versions` has an invalid scheme (`htps`). Did you mean `http` or `https`? The request uri `htps://index.rubygems.org/versions` has an invalid scheme (`htps`). Did you mean `http` or `https`?
E E
@ -869,7 +869,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack" gem "rack"
G G
expect(exitstatus).to eq(19) if exitstatus expect(exitstatus).to eq(19)
expect(err). expect(err).
to include("Bundler cannot continue installing rack (1.0.0)."). to include("Bundler cannot continue installing rack (1.0.0).").
and include("The checksum for the downloaded `rack-1.0.0.gem` does not match the checksum given by the server."). and include("The checksum for the downloaded `rack-1.0.0.gem` does not match the checksum given by the server.").
@ -888,7 +888,7 @@ The checksum of /versions does not match the checksum provided by the server! So
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
G G
expect(exitstatus).to eq(5) if exitstatus expect(exitstatus).to eq(5)
expect(err).to include("The given checksum for rack-1.0.0 (\"checksum!\") is not a valid SHA256 hexdigest nor base64digest") expect(err).to include("The given checksum for rack-1.0.0 (\"checksum!\") is not a valid SHA256 hexdigest nor base64digest")
end end

View file

@ -130,7 +130,7 @@ RSpec.describe "bundle install" do
expect(err).to include("Ruby patchlevel") expect(err).to include("Ruby patchlevel")
expect(err).to include("but your Gemfile specified") expect(err).to include("but your Gemfile specified")
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
end end
it "fails and complains about version on version mismatch" do it "fails and complains about version on version mismatch" do
@ -147,7 +147,7 @@ RSpec.describe "bundle install" do
expect(err).to include("Ruby version") expect(err).to include("Ruby version")
expect(err).to include("but your Gemfile specified") expect(err).to include("but your Gemfile specified")
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
end end
end end
end end

View file

@ -39,7 +39,7 @@ RSpec.describe "bundle install" do
it "disallows --path vendor/bundle --system", :bundler => "< 3" do it "disallows --path vendor/bundle --system", :bundler => "< 3" do
bundle "install --path vendor/bundle --system", :raise_on_error => false bundle "install --path vendor/bundle --system", :raise_on_error => false
expect(err).to include("Please choose only one option.") expect(err).to include("Please choose only one option.")
expect(exitstatus).to eq(15) if exitstatus expect(exitstatus).to eq(15)
end end
it "remembers to disable system gems after the first time with bundle --path vendor/bundle", :bundler => "< 3" do it "remembers to disable system gems after the first time with bundle --path vendor/bundle", :bundler => "< 3" do

View file

@ -170,7 +170,7 @@ G
bundle "platform", :raise_on_error => false bundle "platform", :raise_on_error => false
expect(exitstatus).not_to eq(0) if exitstatus expect(exitstatus).not_to eq(0)
end end
it "raises an error if engine_version is used but engine is not" do it "raises an error if engine_version is used but engine is not" do
@ -183,7 +183,7 @@ G
bundle "platform", :raise_on_error => false bundle "platform", :raise_on_error => false
expect(exitstatus).not_to eq(0) if exitstatus expect(exitstatus).not_to eq(0)
end end
it "raises an error if engine version doesn't match ruby version for MRI" do it "raises an error if engine version doesn't match ruby version for MRI" do
@ -196,7 +196,7 @@ G
bundle "platform", :raise_on_error => false bundle "platform", :raise_on_error => false
expect(exitstatus).not_to eq(0) if exitstatus expect(exitstatus).not_to eq(0)
end end
it "should print if no ruby version is specified" do it "should print if no ruby version is specified" do
@ -265,27 +265,27 @@ G
let(:patchlevel_fixnum) { "#{ruby_version_correct}, :patchlevel => #{RUBY_PATCHLEVEL}1" } let(:patchlevel_fixnum) { "#{ruby_version_correct}, :patchlevel => #{RUBY_PATCHLEVEL}1" }
def should_be_ruby_version_incorrect def should_be_ruby_version_incorrect
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
expect(err).to be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}") expect(err).to be_include("Your Ruby version is #{RUBY_VERSION}, but your Gemfile specified #{not_local_ruby_version}")
end end
def should_be_engine_incorrect def should_be_engine_incorrect
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
expect(err).to be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}") expect(err).to be_include("Your Ruby engine is #{local_ruby_engine}, but your Gemfile specified #{not_local_tag}")
end end
def should_be_engine_version_incorrect def should_be_engine_version_incorrect
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
expect(err).to be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}") expect(err).to be_include("Your #{local_ruby_engine} version is #{local_engine_version}, but your Gemfile specified #{local_ruby_engine} #{not_local_engine_version}")
end end
def should_be_patchlevel_incorrect def should_be_patchlevel_incorrect
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
expect(err).to be_include("Your Ruby patchlevel is #{RUBY_PATCHLEVEL}, but your Gemfile specified #{not_local_patchlevel}") expect(err).to be_include("Your Ruby patchlevel is #{RUBY_PATCHLEVEL}, but your Gemfile specified #{not_local_patchlevel}")
end end
def should_be_patchlevel_fixnum def should_be_patchlevel_fixnum
expect(exitstatus).to eq(18) if exitstatus expect(exitstatus).to eq(18)
expect(err).to be_include("The Ruby patchlevel in your Gemfile must be a string") expect(err).to be_include("The Ruby patchlevel in your Gemfile must be a string")
end end

View file

@ -149,7 +149,7 @@ RSpec.describe "bundler plugin install" do
it "raises an error when both git and local git sources are specified" do it "raises an error when both git and local git sources are specified" do
bundle "plugin install foo --local_git /phony/path/project --git git@gitphony.com:/repo/project", :raise_on_error => false bundle "plugin install foo --local_git /phony/path/project --git git@gitphony.com:/repo/project", :raise_on_error => false
expect(exitstatus).not_to eq(0) if exitstatus expect(exitstatus).not_to eq(0)
expect(err).to eq("Remote and local plugin git sources can't be both specified") expect(err).to eq("Remote and local plugin git sources can't be both specified")
end end
end end