commit da2874cd98a9fb7e857300c379c7fdad25011ac5
parent 43f2382ec0a81bccfdf72230185ecc20f552d8ec
Author: Daniel Barlow <dan@telent.net>
Date: Thu, 12 Aug 2021 23:08:52 +0100
add test for help command
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/spec/cli_spec.rb b/spec/cli_spec.rb
@@ -23,6 +23,7 @@ class <<cli
command.join(":")
end
command :help, "show this message" do
+ "there is no help"
end
end
@@ -71,7 +72,12 @@ RSpec.describe CLI do
it "works for rest parameters" do
expect(cli.dispatch %w(git init --bare))
.to eq "init:--bare"
- end
+ end
+
+ it "works for no parameters" do
+ expect(cli.dispatch %w(help))
+ .to eq "there is no help"
+ end
it "works for flags" do
expect(cli.dispatch ["mail", "dan", "--subject=hello dan"])