Repository navigation
Expand file tree
/
Copy pathunknown-command.feature
More file actions
71 lines (62 loc) · 2.62 KB
/
Copy pathunknown-command.feature
File metadata and controls
71 lines (62 loc) · 2.62 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
71
Feature: Unknown commands and composite commands
Scenario: An unknown cli subcommand suggests the closest one
When I run 'bin/ee cli verison'
Then the command should exit with code 1
And STDOUT should be empty
And STDERR should be:
"""
Error: 'verison' is not a registered subcommand of 'cli'. See 'ee help cli' for available subcommands.
Did you mean 'version'?
"""
Scenario Outline: Common shorthands map to the real subcommand
When I run 'bin/ee cli <typed>'
Then the command should exit with code 1
And STDERR should contain "Did you mean '<suggestion>'?"
Examples:
| typed | suggestion |
| v | version |
| check | check-update |
| cmd-dmp | cmd-dump |
| param-dum | param-dump |
| alais | alias |
Scenario: No suggestion is offered when nothing is close
When I run 'bin/ee cli zzzzzzzzzz'
Then the command should exit with code 1
And STDERR should contain "Error: 'zzzzzzzzzz' is not a registered subcommand of 'cli'."
And STDERR should not contain "Did you mean"
# Unknown top-level commands pass the requirement and migration checks before the lookup.
Scenario: An unknown top-level command suggests the closest one
Given no EasyEngine migration is pending
When I run 'bin/ee sitee'
Then the command should exit with code 1
And STDERR should contain:
"""
Error: 'sitee' is not a registered ee command. See 'ee help' for available commands.
Did you mean 'site'?
"""
Scenario: A composite command without a subcommand prints its usage
When I run 'bin/ee cli'
Then the command should exit with code 0
And STDOUT should contain "usage: ee cli alias [--format=<format>]"
And STDOUT should contain " or: ee cli version"
And STDOUT should contain "See 'ee help cli <command>' for more information on a specific command."
Scenario Outline: Every cli subcommand appears in the cli usage
When I run 'bin/ee cli'
Then STDOUT should match "#^(usage| or): ee cli <subcommand>( |$)#m"
Examples:
| subcommand |
| alias |
| check-update |
| cmd-dump |
| completions |
| has-command |
| info |
| param-dump |
| self-uninstall |
| update |
| version |
Scenario: A subcommand called without its required parameters fails
When I run 'bin/ee cli completions'
Then the command should exit with code 1
And STDERR should contain "missing --line parameter"
And STDERR should contain "missing --point parameter"