зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Fix `bundle update --bundler` no longer updating lockfile
https://github.com/rubygems/rubygems/commit/a053b7e4d4
This commit is contained in:
Родитель
be476f38f9
Коммит
95d2e06c2b
|
@ -69,7 +69,12 @@ module Bundler
|
||||||
SharedHelpers.in_bundle? &&
|
SharedHelpers.in_bundle? &&
|
||||||
lockfile_version &&
|
lockfile_version &&
|
||||||
!lockfile_version.end_with?(".dev") &&
|
!lockfile_version.end_with?(".dev") &&
|
||||||
lockfile_version != current_version
|
lockfile_version != current_version &&
|
||||||
|
!updating?
|
||||||
|
end
|
||||||
|
|
||||||
|
def updating?
|
||||||
|
"update".start_with?(ARGV.first || " ") && ARGV[1..-1].any? {|a| a.start_with?("--bundler") }
|
||||||
end
|
end
|
||||||
|
|
||||||
def installed?
|
def installed?
|
||||||
|
|
|
@ -1130,6 +1130,41 @@ RSpec.describe "bundle update --bundler" do
|
||||||
|
|
||||||
expect(the_bundle.locked_gems.bundler_version).to eq v(Bundler::VERSION)
|
expect(the_bundle.locked_gems.bundler_version).to eq v(Bundler::VERSION)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "updates the bundler version in the lockfile without re-resolving if the locked version is already installed" do
|
||||||
|
system_gems "bundler-2.3.3"
|
||||||
|
|
||||||
|
build_repo4 do
|
||||||
|
build_gem "rack", "1.0"
|
||||||
|
end
|
||||||
|
|
||||||
|
install_gemfile <<-G
|
||||||
|
source "#{file_uri_for(gem_repo4)}"
|
||||||
|
gem "rack"
|
||||||
|
G
|
||||||
|
lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.3.3")
|
||||||
|
|
||||||
|
bundle :update, :bundler => true, :artifice => "vcr", :verbose => true
|
||||||
|
expect(out).to include("Using bundler #{Bundler::VERSION}")
|
||||||
|
|
||||||
|
expect(lockfile).to eq <<~L
|
||||||
|
GEM
|
||||||
|
remote: #{file_uri_for(gem_repo4)}/
|
||||||
|
specs:
|
||||||
|
rack (1.0)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
#{lockfile_platforms}
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
rack
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
|
||||||
|
expect(the_bundle).to include_gem "rack 1.0"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# these specs are slow and focus on integration and therefore are not exhaustive. unit specs elsewhere handle that.
|
# these specs are slow and focus on integration and therefore are not exhaustive. unit specs elsewhere handle that.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче