summaryrefslogtreecommitdiff
path: root/spec/bundler/install
diff options
context:
space:
mode:
authorkrororo <krororo.07@gmail.com>2023-09-20 09:47:23 +0900
committergit <svn-admin@ruby-lang.org>2023-09-27 05:18:10 +0000
commitfbee93fc19420ea2b734cffc742ef34599c380db (patch)
treee026c87737a8ee6031ea09980e28fe74a1e6c828 /spec/bundler/install
parent57c3e45ee8d43c401ff1e52105ecbca2bd4e7550 (diff)
[rubygems/rubygems] Fix bundle install when older revisions of git source
https://github.com/rubygems/rubygems/commit/a30712c0fc
Diffstat (limited to 'spec/bundler/install')
-rw-r--r--spec/bundler/install/git_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/bundler/install/git_spec.rb b/spec/bundler/install/git_spec.rb
index 882f2a2d42..954fd39efe 100644
--- a/spec/bundler/install/git_spec.rb
+++ b/spec/bundler/install/git_spec.rb
@@ -170,5 +170,36 @@ RSpec.describe "bundle install" do
expect(out).to include("Bundle complete!")
end
+
+ it "allows older revisions of git source when clean true" do
+ build_git "foo", "1.0", :path => lib_path("foo")
+ rev = revision_for(lib_path("foo"))
+
+ bundle "config set path vendor/bundle"
+ bundle "config set clean true"
+ install_gemfile <<-G, :verbose => true
+ source "#{file_uri_for(gem_repo1)}"
+ gem "foo", :git => "#{file_uri_for(lib_path("foo"))}"
+ G
+
+ expect(out).to include("Using foo 1.0 from #{file_uri_for(lib_path("foo"))} (at main@#{rev[0..6]})")
+ expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
+
+ old_lockfile = lockfile
+
+ update_git "foo", "2.0", :path => lib_path("foo"), :gemspec => true
+ rev2 = revision_for(lib_path("foo"))
+
+ bundle :update, :all => true, :verbose => true
+ expect(out).to include("Using foo 2.0 (was 1.0) from #{file_uri_for(lib_path("foo"))} (at main@#{rev2[0..6]})")
+ expect(out).to include("Removing foo (#{rev[0..11]})")
+ expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}"
+
+ lockfile(old_lockfile)
+
+ bundle :install, :verbose => true
+ expect(out).to include("Using foo 1.0 from #{file_uri_for(lib_path("foo"))} (at main@#{rev[0..6]})")
+ expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
+ end
end
end