Repository navigation
Expand file tree
/
Copy pathcli-has-command.feature
More file actions
48 lines (42 loc) · 1.57 KB
/
Copy pathcli-has-command.feature
File metadata and controls
48 lines (42 loc) · 1.57 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
Feature: ee cli has-command
Scenario Outline: Registered commands exit with 0 and print nothing
When I run 'bin/ee cli has-command <command>'
Then the command should exit with code 0
And STDOUT should be empty
And STDERR should be empty
Examples:
| command |
| cli |
| "cli version" |
| cli version |
| "site create" |
| "site delete" |
| "config get" |
| "service restart" |
| help |
Scenario Outline: Unknown commands exit with 1 and print nothing
When I run 'bin/ee cli has-command <command>'
Then the command should exit with code 1
And STDOUT should be empty
And STDERR should be empty
Examples:
| command |
| foo |
| "foo bar" |
| "" |
Scenario: has-command without a command prints its usage
When I run 'bin/ee cli has-command'
Then the command should exit with code 1
And STDOUT should contain "usage: ee cli has-command <command_name>..."
Scenario: A command disabled in the config file is reported as missing
Given a file "{TMP}/config.yml" with:
"""
locale: en_US
ee_installer_version: stable
disabled_commands:
- cli version
"""
When I run 'EE_CONFIG_PATH={TMP}/config.yml bin/ee cli has-command "cli version"'
Then the command should exit with code 1
When I run 'EE_CONFIG_PATH={TMP}/config.yml bin/ee cli has-command "cli info"'
Then the command should exit with code 0