forked from wp-cli/wp-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidation.feature
48 lines (42 loc) · 1.16 KB
/
validation.feature
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: Argument validation
In order to catch errors fast
As a user
I need to see warnings and errors when I pass incorrect arguments
Scenario: Passing zero arguments to a variadic command
Given a WP installation
When I try `wp plugin install`
Then the return code should be 1
Then STDOUT should contain:
"""
usage: wp plugin install
"""
Scenario: Validation for early commands
Given an empty directory
And WP files
When I try `wp core config`
Then the return code should be 1
And STDERR should contain:
"""
Parameter errors:
"""
And STDERR should contain:
"""
missing --dbname parameter
"""
When I try `wp core config --invalid --other-invalid`
Then the return code should be 1
And STDERR should contain:
"""
unknown --invalid parameter
"""
And STDERR should contain:
"""
unknown --other-invalid parameter
"""
When I try `wp core version invalid`
Then the return code should be 1
And STDERR should contain:
"""
Error: Too many positional arguments: invalid
"""
And STDOUT should be empty