@@ -7,29 +7,28 @@ Feature: Check for plugin updates
77 When I run `wp plugin install wordpress-importer --activate`
88 Then STDOUT should not be empty
99
10- When I run `wp plugin check-update`
10+ When I run `wp plugin check-update --all `
1111 Then STDOUT should contain:
1212 """
1313 Success: All plugins are up to date.
1414 """
15- And the return code should be 0
1615
17- @require-wp-5.2
18- Scenario : Check for plugin updates with updates available
19- Given a WP install
16+ When I run `wp plugin check-update wordpress-importer`
17+ Then STDOUT should contain:
18+ """
19+ Success: All plugins are up to date.
20+ """
2021
21- When I run `wp plugin install wordpress-importer --version=0.5 --activate`
22- Then STDOUT should not be empty
22+ Scenario : Check for plugin updates should throw an error unless --all given
23+ Given a WP install
2324
24- When I run `wp plugin check-update`
25- Then STDOUT should be a table containing rows:
26- | name | status | version |
27- | wordpress -importer | active | 0 .5 |
28- And STDOUT should contain:
25+ When I try `wp plugin check-update`
26+ Then the return code should be 1
27+ And STDERR should be:
2928 """
30- update_version
29+ Error: Please specify one or more plugins, or use --all.
3130 """
32- And the return code should be 0
31+ And STDOUT should be empty
3332
3433 @require-wp-5.2
3534 Scenario : Check for specific plugin updates
@@ -38,18 +37,11 @@ Feature: Check for plugin updates
3837 When I run `wp plugin install wordpress-importer --version=0.5`
3938 Then STDOUT should not be empty
4039
41- When I run `wp plugin install akismet`
42- Then STDOUT should not be empty
43-
44- When I run `wp plugin check-update wordpress-importer`
45- Then STDOUT should be a table containing rows:
46- | name | status | version |
47- | wordpress -importer | inactive | 0 .5 |
48- And STDOUT should contain:
40+ When I run `wp plugin check-update wordpress-importer --format=csv`
41+ Then STDOUT should contain:
4942 """
50- update_version
43+ wordpress-importer,inactive,0.5,
5144 """
52- And the return code should be 0
5345
5446 @require-wp-5.2
5547 Scenario : Check for all plugin updates with --all flag
@@ -58,15 +50,11 @@ Feature: Check for plugin updates
5850 When I run `wp plugin install wordpress-importer --version=0.5 --activate`
5951 Then STDOUT should not be empty
6052
61- When I run `wp plugin check-update --all`
62- Then STDOUT should be a table containing rows:
63- | name | status | version |
64- | wordpress -importer | active | 0 .5 |
65- And STDOUT should contain:
53+ When I run `wp plugin check-update --all --format=csv`
54+ Then STDOUT should contain:
6655 """
67- update_version
56+ wordpress-importer,active,0.5,
6857 """
69- And the return code should be 0
7058
7159 @require-wp-5.2
7260 Scenario : Check for plugin updates in different output formats
@@ -75,14 +63,13 @@ Feature: Check for plugin updates
7563 When I run `wp plugin install wordpress-importer --version=0.5`
7664 Then STDOUT should not be empty
7765
78- When I run `wp plugin check-update --format=json`
66+ When I run `wp plugin check-update wordpress-importer --format=json`
7967 Then STDOUT should be JSON containing:
8068 """
8169 [{"name":"wordpress-importer","status":"inactive","version":"0.5"}]
8270 """
83- And the return code should be 0
8471
85- When I run `wp plugin check-update --format=csv`
72+ When I run `wp plugin check-update wordpress-importer --format=csv`
8673 Then STDOUT should contain:
8774 """
8875 name,status,version,update_version
@@ -91,7 +78,6 @@ Feature: Check for plugin updates
9178 """
9279 wordpress-importer,inactive,0.5
9380 """
94- And the return code should be 0
9581
9682 @require-wp-5.2
9783 Scenario : Check for plugin updates with custom fields
@@ -100,22 +86,7 @@ Feature: Check for plugin updates
10086 When I run `wp plugin install wordpress-importer --version=0.5`
10187 Then STDOUT should not be empty
10288
103- When I run `wp plugin check-update --fields=name,version`
89+ When I run `wp plugin check-update wordpress-importer --fields=name,version`
10490 Then STDOUT should be a table containing rows:
10591 | name | version |
10692 | wordpress -importer | 0 .5 |
107- And the return code should be 0
108-
109- @require-wp-5.2
110- Scenario : Check for plugin updates when no specific plugin has updates
111- Given a WP install
112-
113- When I run `wp plugin install wordpress-importer`
114- Then STDOUT should not be empty
115-
116- When I run `wp plugin check-update wordpress-importer`
117- Then STDOUT should contain:
118- """
119- Success: All plugins are up to date.
120- """
121- And the return code should be 0
0 commit comments