Skip to content

Commit 4a285dd

Browse files
hsbtdeivid-rodriguez
authored andcommitted
[rubygems/rubygems] Added extra examples for cli_help default command
ruby/rubygems@b2472e7b82 Co-authored-by: David Rodríguez <[email protected]>
1 parent aac6f06 commit 4a285dd

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

spec/bundler/bundler/cli_spec.rb

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def out_with_macos_man_workaround
8787
end
8888

8989
context "with no arguments" do
90-
it "prints a concise help message", bundler: "4" do
90+
it "prints a concise help message by default" do
9191
bundle ""
9292
expect(err).to be_empty
9393
expect(out).to include("Bundler version #{Bundler::VERSION}").
@@ -96,6 +96,23 @@ def out_with_macos_man_workaround
9696
and include("\n\n Utilities:\n").
9797
and include("\n\nOptions:\n")
9898
end
99+
100+
it "prints a concise help message when default_cli_command set to cli_help" do
101+
bundle "config set default_cli_command cli_help"
102+
bundle ""
103+
expect(err).to be_empty
104+
expect(out).to include("Bundler version #{Bundler::VERSION}").
105+
and include("\n\nBundler commands:\n\n").
106+
and include("\n\n Primary commands:\n").
107+
and include("\n\n Utilities:\n").
108+
and include("\n\nOptions:\n")
109+
end
110+
111+
it "runs bundle install when default_cli_command set to install" do
112+
bundle "config set default_cli_command install"
113+
bundle "", raise_on_error: false
114+
expect(err).to include("Could not locate Gemfile")
115+
end
99116
end
100117

101118
context "when ENV['BUNDLE_GEMFILE'] is set to an empty string" do

0 commit comments

Comments
 (0)