summaryrefslogtreecommitdiff
path: root/spec/install/git_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/install/git_spec.rb')
-rw-r--r--spec/install/git_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index a555822012..04f2380b45 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -15,6 +15,28 @@ RSpec.describe "bundle install" do
expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
end
+ it "displays the ref of the gem repository when using branch~num as a ref" do
+ build_git "foo", "1.0", :path => lib_path("foo")
+ rev = revision_for(lib_path("foo"))[0..6]
+ update_git "foo", "2.0", :path => lib_path("foo"), :gemspec => true
+ rev2 = revision_for(lib_path("foo"))[0..6]
+ update_git "foo", "3.0", :path => lib_path("foo"), :gemspec => true
+
+ install_gemfile! <<-G
+ gem "foo", :git => "#{lib_path("foo")}", :ref => "master~2"
+ G
+
+ bundle! :install
+ expect(out).to include("Using foo 1.0 from #{lib_path("foo")} (at master~2@#{rev})")
+ expect(the_bundle).to include_gems "foo 1.0", :source => "git@#{lib_path("foo")}"
+
+ update_git "foo", "4.0", :path => lib_path("foo"), :gemspec => true
+
+ bundle! :update
+ expect(out).to include("Using foo 2.0 (was 1.0) from #{lib_path("foo")} (at master~2@#{rev2})")
+ expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}"
+ end
+
it "should check out git repos that are missing but not being installed" do
build_git "foo"