Skip to content

Commit 90af941

Browse files
committed
Check of exact STDOUT messages
1 parent ab5d73b commit 90af941

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

features/transient.feature

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ Feature: Manage WordPress transient cache
5555
Success: Transient deleted.
5656
"""
5757

58-
When I run `wp transient set foo bar --network`
58+
When I run `wp transient delete --all`
59+
And I run `wp transient set foo bar --network`
5960
And I run `wp transient set foo2 bar2 --network`
6061
And I run `wp transient delete --all`
61-
Then STDOUT should contain:
62+
Then STDOUT should be:
6263
"""
63-
transients deleted from the database.
64+
Success: 2 transients deleted from the database.
6465
"""
6566

6667
Scenario: Transient delete and other flags
@@ -72,13 +73,14 @@ Feature: Manage WordPress transient cache
7273
Error: Please specify transient key, or use --all or --expired.
7374
"""
7475

75-
When I run `wp transient set foo bar`
76+
When I run `wp transient delete --all`
77+
And I run `wp transient set foo bar`
7678
And I run `wp transient set foo2 bar2`
7779
And I run `wp transient set foo3 bar3 --network`
7880
And I run `wp transient delete --all`
79-
Then STDOUT should contain:
81+
Then STDOUT should be:
8082
"""
81-
transients deleted from the database.
83+
Success: 3 transients deleted from the database.
8284
"""
8385

8486
When I try `wp transient get foo`
@@ -108,9 +110,9 @@ Feature: Manage WordPress transient cache
108110
# Change timeout to be in the past.
109111
When I run `wp option update _transient_timeout_foo 1321009871`
110112
And I run `wp transient delete --expired`
111-
Then STDOUT should contain:
113+
Then STDOUT should be:
112114
"""
113-
transient deleted from the database.
115+
Success: 1 expired transient deleted from the database.
114116
"""
115117

116118
When I try `wp transient get foo`
@@ -128,9 +130,9 @@ Feature: Manage WordPress transient cache
128130
# Change timeout to be in the past.
129131
When I run `wp option update _site_transient_timeout_foo 1321009871`
130132
And I run `wp transient delete --expired`
131-
Then STDOUT should contain:
133+
Then STDOUT should be:
132134
"""
133-
transient deleted from the database.
135+
Success: 1 expired transient deleted from the database.
134136
"""
135137

136138
When I try `wp transient get foo --network`
@@ -142,13 +144,14 @@ Feature: Manage WordPress transient cache
142144
Scenario: Network transient delete and other flags
143145
Given a WP multisite install
144146

145-
When I run `wp transient set foo bar`
147+
When I run `wp transient delete --all`
148+
And I run `wp transient set foo bar`
146149
And I run `wp transient set foo2 bar2`
147150
And I run `wp transient set foo3 bar3 --network`
148151
And I run `wp transient delete --all`
149-
Then STDOUT should contain:
152+
Then STDOUT should be:
150153
"""
151-
transients deleted from the database.
154+
Success: 3 transients deleted from the database.
152155
"""
153156

154157
When I try `wp transient get foo`
@@ -178,9 +181,9 @@ Feature: Manage WordPress transient cache
178181
# Change timeout to be in the past.
179182
When I run `wp option update _transient_timeout_foo 1321009871`
180183
And I run `wp transient delete --expired`
181-
Then STDOUT should contain:
184+
Then STDOUT should be:
182185
"""
183-
transient deleted from the database.
186+
Success: 1 expired transient deleted from the database.
184187
"""
185188

186189
When I try `wp transient get foo`
@@ -198,9 +201,9 @@ Feature: Manage WordPress transient cache
198201
# Change timeout to be in the past.
199202
When I run `wp site option update _site_transient_timeout_foo 1321009871`
200203
And I run `wp transient delete --expired`
201-
Then STDOUT should contain:
204+
Then STDOUT should be:
202205
"""
203-
transient deleted from the database.
206+
Success: 1 expired transient deleted from the database.
204207
"""
205208

206209
When I try `wp transient get foo --network`

0 commit comments

Comments
 (0)