[rubygems/rubygems] Add test for fixing mismatched versions in lockfile
This test confirms that a bug that existed in 2.6.3 was fixed by https://github.com/rubygems/rubygems/commit/b8e55087f026 https://github.com/rubygems/rubygems/commit/9e4ca5c5b2
This commit is contained in:
parent
319fcca656
commit
2eb5690ab6
@ -1908,6 +1908,63 @@ RSpec.describe "the lockfile format" do
|
|||||||
L
|
L
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "automatically fixes the lockfile when it includes a gem under the correct GIT section, but also under an incorrect GEM section, with a higher version" do
|
||||||
|
git = build_git "foo"
|
||||||
|
|
||||||
|
gemfile <<~G
|
||||||
|
source "https://gem.repo1/"
|
||||||
|
gem "foo", "= 1.0", git: "#{lib_path("foo-1.0")}"
|
||||||
|
G
|
||||||
|
|
||||||
|
# If the lockfile erroneously lists platform versions of the gem
|
||||||
|
# that don't match the locked version of the git repo we should remove them.
|
||||||
|
|
||||||
|
lockfile <<~L
|
||||||
|
GIT
|
||||||
|
remote: #{lib_path("foo-1.0")}
|
||||||
|
revision: #{git.ref_for("main")}
|
||||||
|
specs:
|
||||||
|
foo (1.0)
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: https://gem.repo1/
|
||||||
|
specs:
|
||||||
|
foo (1.1-x86_64-linux-gnu)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
#{lockfile_platforms}
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
foo (= 1.0)!
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
|
||||||
|
bundle "install"
|
||||||
|
|
||||||
|
expect(lockfile).to eq <<~L
|
||||||
|
GIT
|
||||||
|
remote: #{lib_path("foo-1.0")}
|
||||||
|
revision: #{git.ref_for("main")}
|
||||||
|
specs:
|
||||||
|
foo (1.0)
|
||||||
|
|
||||||
|
GEM
|
||||||
|
remote: https://gem.repo1/
|
||||||
|
specs:
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
#{lockfile_platforms}
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
foo (= 1.0)!
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
end
|
||||||
|
|
||||||
it "automatically fixes the lockfile when it has incorrect deps, keeping the locked version" do
|
it "automatically fixes the lockfile when it has incorrect deps, keeping the locked version" do
|
||||||
build_repo4 do
|
build_repo4 do
|
||||||
build_gem "net-smtp", "0.5.0" do |s|
|
build_gem "net-smtp", "0.5.0" do |s|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user