Merge pull request #3604 from alyssais/cask_no_arguments
cask: exit successfully when given no arguments.
This commit is contained in:
commit
c6eaa73db1
@ -229,6 +229,7 @@ module Hbc
|
|||||||
purpose
|
purpose
|
||||||
usage
|
usage
|
||||||
|
|
||||||
|
return if @command.nil?
|
||||||
return if @command == "help" && @args.empty?
|
return if @command == "help" && @args.empty?
|
||||||
|
|
||||||
raise ArgumentError, "help does not take arguments."
|
raise ArgumentError, "help does not take arguments."
|
||||||
|
@ -16,10 +16,16 @@ describe Hbc::CLI, :cask do
|
|||||||
it "ignores the `--language` option, which is handled in `OS::Mac`" do
|
it "ignores the `--language` option, which is handled in `OS::Mac`" do
|
||||||
cli = described_class.new("--language=en")
|
cli = described_class.new("--language=en")
|
||||||
expect(cli).to receive(:detect_command_and_arguments).with(no_args)
|
expect(cli).to receive(:detect_command_and_arguments).with(no_args)
|
||||||
expect(cli).to receive(:exit).with(1)
|
|
||||||
cli.run
|
cli.run
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "when given no arguments" do
|
||||||
|
it "exits successfully" do
|
||||||
|
expect(subject).not_to receive(:exit).with(be_nonzero)
|
||||||
|
subject.run
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "when no option is specified" do
|
context "when no option is specified" do
|
||||||
it "--binaries is true by default" do
|
it "--binaries is true by default" do
|
||||||
command = Hbc::CLI::Install.new("some-cask")
|
command = Hbc::CLI::Install.new("some-cask")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user