Skip to content

Commit b2472e7

Browse files
Added extra examples for cli_help default command
Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com>
1 parent 31d67ec commit b2472e7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

bundler/spec/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)