forked from lets-cli/lets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_group_long.bats
More file actions
70 lines (53 loc) · 2.01 KB
/
command_group_long.bats
File metadata and controls
70 lines (53 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
load test_helpers
setup() {
load "${BATS_UTILS_PATH}/bats-support/load.bash"
load "${BATS_UTILS_PATH}/bats-assert/load.bash"
cd ./tests/command_group_long
}
HELP_MESSAGE=$(cat <<EOF
A CLI task runner
Usage:
lets [flags]
lets [command]
Commands:
A group
c c command
B group
a a command
b b command
Common
d d command
super_long_command_longer_than_usual Super long command
Internal commands:
help Help about any command
self Manage lets CLI itself
Flags:
--all show all commands (including the ones with _)
-c, --config string config file (default is lets.yaml)
-d, --debug count show debug logs (or use LETS_DEBUG=1). If used multiple times, shows more verbose logs
-E, --env stringToString set env variable for running command KEY=VALUE (default [])
--exclude stringArray run all but excluded command(s) described in cmd as map
-h, --help help for lets
--init create a new lets.yaml in the current folder
--no-depends skip 'depends' for running command
--only stringArray run only specified command(s) described in cmd as map
--upgrade upgrade lets to latest version
-v, --version version for lets
Use "lets help [command]" for more information about a command.
EOF
)
@test "help: running 'lets help' should group commands by their group names" {
run lets help
assert_success
assert_output "$HELP_MESSAGE"
}
@test "help: running 'lets --help' should group commands by their group names" {
run lets --help
assert_success
assert_output "$HELP_MESSAGE"
}
@test "help: running 'lets' should group commands by their group names" {
run lets
assert_success
assert_output "$HELP_MESSAGE"
}