From 4a285dd91aaacc7da44ce63191f41a1a1c287828 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 10 Oct 2025 15:32:29 +0900 Subject: [PATCH] [rubygems/rubygems] Added extra examples for cli_help default command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rubygems/rubygems/commit/b2472e7b82 Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com> --- spec/bundler/bundler/cli_spec.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/spec/bundler/bundler/cli_spec.rb b/spec/bundler/bundler/cli_spec.rb index 07f589bd5d..b3a97e72ce 100644 --- a/spec/bundler/bundler/cli_spec.rb +++ b/spec/bundler/bundler/cli_spec.rb @@ -87,7 +87,7 @@ RSpec.describe "bundle executable" do end context "with no arguments" do - it "prints a concise help message", bundler: "4" do + it "prints a concise help message by default" do bundle "" expect(err).to be_empty expect(out).to include("Bundler version #{Bundler::VERSION}"). @@ -96,6 +96,23 @@ RSpec.describe "bundle executable" do and include("\n\n Utilities:\n"). and include("\n\nOptions:\n") end + + it "prints a concise help message when default_cli_command set to cli_help" do + bundle "config set default_cli_command cli_help" + bundle "" + expect(err).to be_empty + expect(out).to include("Bundler version #{Bundler::VERSION}"). + and include("\n\nBundler commands:\n\n"). + and include("\n\n Primary commands:\n"). + and include("\n\n Utilities:\n"). + and include("\n\nOptions:\n") + end + + it "runs bundle install when default_cli_command set to install" do + bundle "config set default_cli_command install" + bundle "", raise_on_error: false + expect(err).to include("Could not locate Gemfile") + end end context "when ENV['BUNDLE_GEMFILE'] is set to an empty string" do