Skip to content

Commit 27849b8

Browse files
authored
Merge pull request #436 from wp-cli/fix-gherkin-issues
Fix Gherkin lint issues
2 parents 6f245e7 + 1532817 commit 27849b8

File tree

2 files changed

+22
-33
lines changed

2 files changed

+22
-33
lines changed

features/makejson.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,4 +984,3 @@ Feature: Split PO files into JSON files.
984984
"""
985985
And the return code should be 0
986986
And the foo-theme/my-custom-domain-de_DE-557240f2080a0894dbd39f5c2f559bf8.json file should exist
987-

features/makepot.feature

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Feature: Generate a POT file of a WordPress project
3232

3333
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
3434
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should exist
35-
Then STDOUT should be:
35+
And STDOUT should be:
3636
"""
3737
Plugin file detected.
3838
Success: POT file successfully generated.
@@ -58,8 +58,7 @@ Feature: Generate a POT file of a WordPress project
5858

5959
Scenario: Does not include empty file headers.
6060
When I run `wp scaffold plugin hello-world --plugin_description=""`
61-
62-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
61+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
6362
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should exist
6463
And the wp-content/plugins/hello-world/languages/hello-world.pot file should not contain:
6564
"""
@@ -102,13 +101,12 @@ Feature: Generate a POT file of a WordPress project
102101

103102
Scenario: Adds copyright comments
104103
When I run `wp scaffold plugin hello-world`
105-
106-
When I run `date +"%Y"`
104+
And I run `date +"%Y"`
107105
Then STDOUT should not be empty
108106
And save STDOUT as {YEAR}
109107

110108
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
111-
And the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
109+
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
112110
"""
113111
# Copyright (C) {YEAR} YOUR NAME HERE
114112
# This file is distributed under the same license as the Hello World plugin.
@@ -144,27 +142,24 @@ Feature: Generate a POT file of a WordPress project
144142

145143
Scenario: Sets Project-Id-Version
146144
When I run `wp scaffold plugin hello-world`
147-
148-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
149-
And the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
145+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
146+
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
150147
"""
151148
"Project-Id-Version: Hello World 0.1.0\n"
152149
"""
153150

154151
Scenario: Sets Report-Msgid-Bugs-To
155152
When I run `wp scaffold plugin hello-world`
156-
157-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
153+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
158154
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
159155
"""
160156
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/hello-world\n"
161157
"""
162158

163159
Scenario: Sets custom Report-Msgid-Bugs-To
164160
When I run `wp scaffold plugin hello-world`
165-
166-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --headers='{"Report-Msgid-Bugs-To":"https://github.com/hello-world/hello-world/"}'`
167-
And the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
161+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --headers='{"Report-Msgid-Bugs-To":"https://github.com/hello-world/hello-world/"}'`
162+
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
168163
"""
169164
"Report-Msgid-Bugs-To: https://github.com/hello-world/hello-world/\n"
170165
"""
@@ -175,26 +170,23 @@ Feature: Generate a POT file of a WordPress project
175170

176171
Scenario: Sets custom header
177172
When I run `wp scaffold plugin hello-world`
178-
179-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --headers='{"X-Poedit-Basepath":".."}'`
180-
And the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
173+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --headers='{"X-Poedit-Basepath":".."}'`
174+
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
181175
"""
182176
"X-Poedit-Basepath: ..\n"
183177
"""
184178

185179
Scenario: Sets a placeholder PO-Revision-Date header
186180
When I run `wp scaffold plugin hello-world`
187-
188-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
181+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
189182
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
190183
"""
191184
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
192185
"""
193186

194187
Scenario: Sets the last translator and the language team
195188
When I run `wp scaffold plugin hello-world`
196-
197-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
189+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
198190
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
199191
"""
200192
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -203,8 +195,7 @@ Feature: Generate a POT file of a WordPress project
203195

204196
Scenario: Sets the generator header
205197
When I run `wp scaffold plugin hello-world`
206-
207-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
198+
And I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
208199
Then the contents of the wp-content/plugins/hello-world/languages/hello-world.pot file should match /X-Generator:\s/
209200

210201
Scenario: Ignores any other text domain
@@ -589,7 +580,7 @@ Feature: Generate a POT file of a WordPress project
589580
Scenario: Extract translator comments
590581
Given I run `echo "\t"`
591582
And save STDOUT as {TAB}
592-
Given an empty foo-plugin directory
583+
And an empty foo-plugin directory
593584
And a foo-plugin/foo-plugin.php file:
594585
"""
595586
<?php
@@ -1018,7 +1009,7 @@ Feature: Generate a POT file of a WordPress project
10181009
"""
10191010
Extracted 4 strings
10201011
"""
1021-
Then the foo-plugin.pot file should not contain:
1012+
And the foo-plugin.pot file should not contain:
10221013
"""
10231014
I am being ignored
10241015
"""
@@ -1057,7 +1048,7 @@ Feature: Generate a POT file of a WordPress project
10571048
<?php
10581049
__( 'I am being ignored', 'foo-plugin' );
10591050
"""
1060-
And a foo-plugin/bar/ignored.js file:
1051+
And a foo-plugin/bar/ignored.js file:
10611052
"""
10621053
__( 'I am being ignored', 'foo-plugin' );
10631054
"""
@@ -1554,7 +1545,7 @@ Feature: Generate a POT file of a WordPress project
15541545

15551546
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --merge=foo-plugin/foo-plugin.pot`
15561547
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should exist
1557-
Then STDOUT should be:
1548+
And STDOUT should be:
15581549
"""
15591550
Plugin file detected.
15601551
Success: POT file successfully generated.
@@ -1625,7 +1616,7 @@ Feature: Generate a POT file of a WordPress project
16251616

16261617
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --merge=foo-plugin/foo-plugin.pot,foo-plugin/bar-plugin.pot`
16271618
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should exist
1628-
Then STDOUT should be:
1619+
And STDOUT should be:
16291620
"""
16301621
Plugin file detected.
16311622
Success: POT file successfully generated.
@@ -1734,7 +1725,7 @@ Feature: Generate a POT file of a WordPress project
17341725

17351726
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot --merge=foo-plugin/foo-plugin.pot`
17361727
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should exist
1737-
Then STDOUT should be:
1728+
And STDOUT should be:
17381729
"""
17391730
Plugin file detected.
17401731
Success: POT file successfully generated.
@@ -2324,7 +2315,7 @@ Feature: Generate a POT file of a WordPress project
23242315
"""
23252316
msgid "bar"
23262317
"""
2327-
And the foo-plugin.pot file should not contain:
2318+
And the foo-plugin.pot file should not contain:
23282319
"""
23292320
msgid "Hello JSX"
23302321
"""
@@ -2462,7 +2453,7 @@ Feature: Generate a POT file of a WordPress project
24622453
"""
24632454
msgid "Hello World from PHP"
24642455
"""
2465-
And the foo-plugin.pot file should contain:
2456+
And the foo-plugin.pot file should contain:
24662457
"""
24672458
msgid "Hello World from JavaScript"
24682459
"""
@@ -3680,7 +3671,6 @@ Feature: Generate a POT file of a WordPress project
36803671
msgid "Black"
36813672
"""
36823673

3683-
36843674
Scenario: Extract strings from the top-level section of theme.json files
36853675
Given an empty foo-theme directory
36863676
And a foo-theme/theme.json file:

0 commit comments

Comments
 (0)