summaryrefslogtreecommitdiff
path: root/spec/bundler/install/git_spec.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-01-14 13:38:17 +0900
committerNARUSE, Yui <nurse@users.noreply.github.com>2021-01-14 16:44:42 +0900
commit93dcf0828dc8e627e0c24497795d927911a9d993 (patch)
tree391f87ebf731d82c74fc44322a012024c3bd62f7 /spec/bundler/install/git_spec.rb
parentc721e36ceca587d823a765cbbad90911a20cffce (diff)
Merge Bundler-2.2.5
Diffstat (limited to 'spec/bundler/install/git_spec.rb')
-rw-r--r--spec/bundler/install/git_spec.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/spec/bundler/install/git_spec.rb b/spec/bundler/install/git_spec.rb
index 62658137e0..61eaee4a84 100644
--- a/spec/bundler/install/git_spec.rb
+++ b/spec/bundler/install/git_spec.rb
@@ -2,10 +2,10 @@
RSpec.describe "bundle install" do
context "git sources" do
- it "displays the revision hash of the gem repository", :bundler => "< 3" do
+ it "displays the revision hash of the gem repository" do
build_git "foo", "1.0", :path => lib_path("foo")
- install_gemfile <<-G
+ install_gemfile <<-G, :verbose => true
gem "foo", :git => "#{file_uri_for(lib_path("foo"))}"
G
@@ -13,7 +13,18 @@ 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", :bundler => "< 3" do
+ it "displays the correct default branch" do
+ build_git "foo", "1.0", :path => lib_path("foo"), :default_branch => "main"
+
+ install_gemfile <<-G, :verbose => true
+ 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@#{revision_for(lib_path("foo"))[0..6]})")
+ 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
skip "maybe branch~num notation doesn't work on Windows' git" if Gem.win_platform?
build_git "foo", "1.0", :path => lib_path("foo")
@@ -22,7 +33,7 @@ RSpec.describe "bundle install" do
rev2 = revision_for(lib_path("foo"))[0..6]
update_git "foo", "3.0", :path => lib_path("foo"), :gemspec => true
- install_gemfile <<-G
+ install_gemfile <<-G, :verbose => true
gem "foo", :git => "#{file_uri_for(lib_path("foo"))}", :ref => "master~2"
G
@@ -31,7 +42,7 @@ RSpec.describe "bundle install" do
update_git "foo", "4.0", :path => lib_path("foo"), :gemspec => true
- bundle :update, :all => true
+ 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 master~2@#{rev2})")
expect(the_bundle).to include_gems "foo 2.0", :source => "git@#{lib_path("foo")}"
end