ruby-changes:72694
From: David <ko1@a...>
Date: Wed, 27 Jul 2022 01:04:31 +0900 (JST)
Subject: [ruby-changes:72694] 163e3f075f (master): [rubygems/rubygems] Use main as default branch for Bundler specs
https://git.ruby-lang.org/ruby.git/commit/?id=163e3f075f From 163e3f075f71342fa5897beedf771e3e878876de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Mon, 25 Jul 2022 18:22:56 +0200 Subject: [rubygems/rubygems] Use main as default branch for Bundler specs https://github.com/rubygems/rubygems/commit/482077d185 --- spec/bundler/bundler/gem_helper_spec.rb | 5 +-- spec/bundler/cache/git_spec.rb | 20 ++++++------ spec/bundler/commands/info_spec.rb | 4 +-- spec/bundler/commands/open_spec.rb | 2 +- spec/bundler/commands/pristine_spec.rb | 2 +- spec/bundler/commands/remove_spec.rb | 2 +- spec/bundler/commands/show_spec.rb | 4 +-- spec/bundler/install/gemfile/git_spec.rb | 36 +++++++++++----------- .../install/gemfile/specific_platform_spec.rb | 2 +- spec/bundler/install/git_spec.rb | 8 ++--- spec/bundler/lock/lockfile_spec.rb | 6 ++-- spec/bundler/plugins/source/example_spec.rb | 6 ++-- spec/bundler/runtime/setup_spec.rb | 14 ++++----- spec/bundler/support/builders.rb | 2 +- spec/bundler/update/git_spec.rb | 10 +++--- 15 files changed, 62 insertions(+), 61 deletions(-) diff --git a/spec/bundler/bundler/gem_helper_spec.rb b/spec/bundler/bundler/gem_helper_spec.rb index 5cd79de620..7d955007ab 100644 --- a/spec/bundler/bundler/gem_helper_spec.rb +++ b/spec/bundler/bundler/gem_helper_spec.rb @@ -11,6 +11,7 @@ RSpec.describe Bundler::GemHelper do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/gem_helper_spec.rb#L11 before(:each) do global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false", "BUNDLE_GEM__LINTER" => "false", "BUNDLE_GEM__CI" => "false", "BUNDLE_GEM__CHANGELOG" => "false" + sys_exec("git config --global init.defaultBranch main") bundle "gem #{app_name}" prepare_gemspec(app_gemspec_path) end @@ -295,7 +296,7 @@ RSpec.describe Bundler::GemHelper do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/gem_helper_spec.rb#L296 mock_confirm_message "Tagged v#{app_version}." mock_confirm_message "Pushed git commits and release tag." - sys_exec("git push -u origin master", :dir => app_path) + sys_exec("git push -u origin main", :dir => app_path) end it "calls rubygem_push with proper arguments" do @@ -336,7 +337,7 @@ RSpec.describe Bundler::GemHelper do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/gem_helper_spec.rb#L337 mock_build_message app_name, app_version mock_confirm_message "Pushed git commits and release tag." - sys_exec("git push -u origin master", :dir => app_path) + sys_exec("git push -u origin main", :dir => app_path) expect(subject).to receive(:rubygem_push).with(app_gem_path.to_s) end diff --git a/spec/bundler/cache/git_spec.rb b/spec/bundler/cache/git_spec.rb index b88993e9b1..7ea23cd312 100644 --- a/spec/bundler/cache/git_spec.rb +++ b/spec/bundler/cache/git_spec.rb @@ -15,7 +15,7 @@ end https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L15 RSpec.describe "bundle cache with git" do it "copies repository to vendor cache and uses it" do git = build_git "foo" - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -34,7 +34,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L34 it "copies repository to vendor cache and uses it even when configured with `path`" do git = build_git "foo" - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -72,7 +72,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L72 it "tracks updates" do git = build_git "foo" - old_ref = git.ref_for("master", 11) + old_ref = git.ref_for("main", 11) install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -86,7 +86,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L86 s.write "lib/foo.rb", "puts :CACHE" end - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) expect(ref).not_to eq(old_ref) bundle "update", :all => true @@ -103,7 +103,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L103 it "tracks updates when specifying the gem" do git = build_git "foo" - old_ref = git.ref_for("master", 11) + old_ref = git.ref_for("main", 11) install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -117,7 +117,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L117 s.write "lib/foo.rb", "puts :CACHE" end - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) expect(ref).not_to eq(old_ref) bundle "update foo" @@ -132,11 +132,11 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L132 it "uses the local repository to generate the cache" do git = build_git "foo" - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) gemfile <<-G source "#{file_uri_for(gem_repo1)}" - gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :master + gem "foo", :git => '#{lib_path("foo-invalid")}', :branch => :main G bundle %(config set local.foo #{lib_path("foo-1.0")}) @@ -172,7 +172,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L172 end G - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) bundle "config set cache_all true" bundle :cache @@ -196,7 +196,7 @@ RSpec.describe "bundle cache with git" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/cache/git_spec.rb#L196 bundle "config set cache_all true" bundle :cache - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) gemspec = bundled_app("vendor/cache/foo-1.0-#{ref}/foo.gemspec").read expect(gemspec).to_not match("`echo bob`") end diff --git a/spec/bundler/commands/info_spec.rb b/spec/bundler/commands/info_spec.rb index 74943703a2..e4b970eb34 100644 --- a/spec/bundler/commands/info_spec.rb +++ b/spec/bundler/commands/info_spec.rb @@ -163,10 +163,10 @@ RSpec.describe "bundle info" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/info_spec.rb#L163 expect(the_bundle).to include_gems "foo 1.0" bundle "info foo" - expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") + expect(out).to include("foo (1.0 #{@git.ref_for("main", 6)}") end - it "prints out branch names other than master" do + it "prints out branch names other than main" do update_git "foo", :branch => "omg" do |s| s.write "lib/foo.rb", "FOO = '1.0.omg'" end diff --git a/spec/bundler/commands/open_spec.rb b/spec/bundler/commands/open_spec.rb index 53dc35c2c7..85f15176b4 100644 --- a/spec/bundler/commands/open_spec.rb +++ b/spec/bundler/commands/open_spec.rb @@ -36,7 +36,7 @@ RSpec.describe "bundle open" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/open_spec.rb#L36 it "does not blow up if the gem to open does not have a Gemfile" do git = build_git "foo" - ref = git.ref_for("master", 11) + ref = git.ref_for("main", 11) install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" diff --git a/spec/bundler/commands/pristine_spec.rb b/spec/bundler/commands/pristine_spec.rb index fe85e1ecd1..9e496dc91a 100644 --- a/spec/bundler/commands/pristine_spec.rb +++ b/spec/bundler/commands/pristine_spec.rb @@ -22,7 +22,7 @@ RSpec.describe "bundle pristine" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/pristine_spec.rb#L22 source "#{file_uri_for(gem_repo2)}" gem "weakling" gem "very_simple_binary" - gem "foo", :git => "#{lib_path("foo")}", :branch => "master" + gem "foo", :git => "#{lib_path("foo")}", :branch => "main" gem "git_with_ext", :git => "#{lib_path("git_with_ext")}" gem "bar", :path => "#{lib_path("bar")}" diff --git a/spec/bundler/commands/remove_spec.rb b/spec/bundler/commands/remove_spec.rb index ceba6c5ede..093130f7d5 100644 --- a/spec/bundler/commands/remove_spec.rb +++ b/spec/bundler/commands/remove_spec.rb @@ -86,7 +86,7 @@ RSpec.describe "bundle remove" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/remove_spec.rb#L86 gem 'git' gem 'rack', git: "#{lib_path("rack-1.0")}", - branch: 'master' + branch: 'main' gem 'nokogiri' G diff --git a/spec/bundler/commands/show_spec.rb b/spec/bundler/commands/show_spec.rb index 2adb121616..925e40b71b 100644 --- a/spec/bundler/commands/show_spec.rb +++ b/spec/bundler/commands/show_spec.rb @@ -100,10 +100,10 @@ RSpec.describe "bundle show", :bundler => "< 3" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/show_spec.rb#L100 expect(the_bundle).to include_gems "foo 1.0" bundle :show - expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") + expect(out).to include("foo (1.0 #{@git.ref_for("main", 6)}") end - it "prints out branch names other than master" do + it "prints out branch names other than main" do update_git "foo", :branch => "omg" (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/