From 2a15b28a9ec59d41fc3f9a5e17cf3efe6d0817b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 30 Nov 2021 18:03:14 +0100 Subject: [rubygems/rubygems] Fix materialization of locked 0 prereleases Since the default requirement in rubygems is ">= 0", it was failing to match 0 prereleases. Changing the default globally to be ">= 0.a" instead is a major refactoring that's quite tricky to make backwards compatible, so I'm special casing this where needed for now to fix the regression. https://github.com/rubygems/rubygems/commit/68fe37937c --- spec/bundler/install/gemfile/path_spec.rb | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'spec/bundler') diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb index 4143b04c2a..db5db31d42 100644 --- a/spec/bundler/install/gemfile/path_spec.rb +++ b/spec/bundler/install/gemfile/path_spec.rb @@ -183,6 +183,39 @@ RSpec.describe "bundle install with explicit source paths" do expect(the_bundle).to include_gems "foo 1.0" end + it "works when using prereleases of 0.0.0" do + build_lib "foo", "0.0.0.dev", :path => lib_path("foo") + + gemfile <<~G + source "#{file_uri_for(gem_repo1)}" + gem "foo", :path => "#{lib_path("foo")}" + G + + lockfile <<~L + PATH + remote: #{lib_path("foo")} + specs: + foo (0.0.0.dev) + + GEM + remote: #{file_uri_for(gem_repo1)}/ + specs: + + PLATFORMS + #{lockfile_platforms} + + DEPENDENCIES + foo! + + BUNDLED WITH + #{Bundler::VERSION} + L + + bundle :install + + expect(the_bundle).to include_gems "foo 0.0.0.dev" + end + it "handles downgrades" do build_lib "omg", "2.0", :path => lib_path("omg") -- cgit v1.2.3