зеркало из https://github.com/github/ruby.git
[bundler/bundler] Update error messages to be more precise
https://github.com/bundler/bundler/commit/9ddeeb1fe1
This commit is contained in:
Родитель
f40914e3cf
Коммит
cb6abf551a
|
@ -87,7 +87,7 @@ m = Module.new do
|
|||
require "bundler/version"
|
||||
end
|
||||
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
||||
warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
|
||||
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
||||
exit 42
|
||||
end
|
||||
|
||||
|
|
|
@ -135,8 +135,8 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
it "runs the correct version of bundler" do
|
||||
sys_exec "#{bundled_app("bin/bundle")} install", "BUNDLER_VERSION" => "999.999.999"
|
||||
expect(exitstatus).to eq(42) if exitstatus
|
||||
expect(err).to include("Activating bundler (999.999.999) failed:").
|
||||
and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -145,8 +145,8 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
lockfile lockfile.gsub(system_bundler_version, "999.999.999")
|
||||
sys_exec "#{bundled_app("bin/bundle")} install"
|
||||
expect(exitstatus).to eq(42) if exitstatus
|
||||
expect(err).to include("Activating bundler (999.999.999) failed:").
|
||||
and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
|
||||
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
|
||||
|
||||
it "runs the correct version of bundler when the version is older and a different major" do
|
||||
|
@ -154,8 +154,8 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
lockfile lockfile.gsub(system_bundler_version, "44.0")
|
||||
sys_exec "#{bundled_app("bin/bundle")} install"
|
||||
expect(exitstatus).to eq(42) if exitstatus
|
||||
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'`")
|
||||
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
|
||||
|
||||
it "runs the available version of bundler when the version is older and the same major" do
|
||||
|
@ -163,7 +163,7 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
lockfile lockfile.gsub(system_bundler_version, "55.0")
|
||||
sys_exec "#{bundled_app("bin/bundle")} install"
|
||||
expect(exitstatus).not_to eq(42) if exitstatus
|
||||
expect(err).not_to include("Activating bundler (55.0) failed:")
|
||||
expect(err).not_to include("Activating bundler (~> 55.0) failed:")
|
||||
end
|
||||
|
||||
it "runs the correct version of bundler when the version is a pre-release" do
|
||||
|
@ -171,8 +171,8 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
lockfile lockfile.gsub(system_bundler_version, "2.12.0.a")
|
||||
sys_exec "#{bundled_app("bin/bundle")} install"
|
||||
expect(exitstatus).to eq(42) if exitstatus
|
||||
expect(err).to include("Activating bundler (2.12.0.a) failed:").
|
||||
and include("To install the version of bundler this project requires, run `gem install bundler -v '2.12.0.a'`")
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -187,8 +187,8 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
it "calls through to the explicit bundler version" do
|
||||
sys_exec "#{bundled_app("bin/bundle")} update --bundler=999.999.999"
|
||||
expect(exitstatus).to eq(42) if exitstatus
|
||||
expect(err).to include("Activating bundler (999.999.999) failed:").
|
||||
and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -213,8 +213,8 @@ RSpec.describe "bundle binstubs <gem>" do
|
|||
it "attempts to load that version" do
|
||||
sys_exec bundled_app("bin/rackup").to_s
|
||||
expect(exitstatus).to eq(42) if exitstatus
|
||||
expect(err).to include("Activating bundler (999.999.999) failed:").
|
||||
and include("To install the version of bundler this project requires, run `gem install bundler -v '999.999.999'`")
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче