-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy paththeme-check-update.feature
More file actions
98 lines (77 loc) · 2.79 KB
/
theme-check-update.feature
File metadata and controls
98 lines (77 loc) · 2.79 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Feature: Check for theme updates
Scenario: Check for theme updates with no updates available
Given a WP install
When I run `wp theme install twentytwelve --force`
And I run `wp theme update --all`
And I run `wp theme check-update --all`
Then STDOUT should contain:
"""
Success: All themes are up to date.
"""
When I run `wp theme check-update twentytwelve`
Then STDOUT should contain:
"""
Success: All themes are up to date.
"""
Scenario: Check for theme updates should throw an error unless --all given
Given a WP install
When I try `wp theme check-update`
Then the return code should be 1
And STDERR should be:
"""
Error: Please specify one or more themes, or use --all.
"""
And STDOUT should be empty
Scenario: Check for specific theme updates
Given a WP install
When I run `wp theme install twentyfourteen --version=1.0 --force`
Then STDOUT should not be empty
When I run `wp theme install twentytwelve --force`
Then STDOUT should not be empty
When I run `wp theme check-update twentyfourteen --format=csv`
Then STDOUT should contain:
"""
twentyfourteen,inactive,1.0,
"""
Scenario: Check for all theme updates with --all flag
Given a WP install
When I run `wp theme install twentyfourteen --version=1.0 --force`
Then STDOUT should not be empty
When I run `wp theme check-update --all --format=csv`
Then STDOUT should contain:
"""
twentyfourteen,inactive,1.0,
"""
Scenario: Check for theme updates in different output formats
Given a WP install
When I run `wp theme install twentyfourteen --version=1.0 --force`
Then STDOUT should not be empty
When I run `wp theme check-update twentyfourteen --format=json`
Then STDOUT should be JSON containing:
"""
[{"name":"twentyfourteen","status":"inactive","version":"1.0"}]
"""
When I run `wp theme check-update twentyfourteen --format=csv`
Then STDOUT should contain:
"""
name,status,version,update_version
"""
And STDOUT should contain:
"""
twentyfourteen,inactive,1.0
"""
Scenario: Check for theme updates with custom fields
Given a WP install
When I run `wp theme install twentyfourteen --version=1.0 --force`
Then STDOUT should not be empty
When I run `wp theme check-update twentyfourteen --fields=name,version`
Then STDOUT should be a table containing rows:
| name | version |
| twentyfourteen | 1.0 |
Scenario: Check for invalid theme should error
Given a WP install
When I try `wp theme check-update invalid-theme-name`
Then STDERR should contain:
"""
Warning: The 'invalid-theme-name' theme could not be found.
"""