Skip to content

Commit cbed9e1

Browse files
authored
Further Windows compatibility improvements (#485)
1 parent ddf8b84 commit cbed9e1

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

features/makepot.feature

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,9 @@ Feature: Generate a POT file of a WordPress project
9999
Plugin Description
100100
"""
101101

102-
@skip-windows
103-
Scenario: Adds copyright comments
104-
When I run `wp scaffold plugin hello-world`
105-
And I run `date +"%Y"`
106-
Then STDOUT should not be empty
107-
And save STDOUT as {YEAR}
108-
109-
When I run `wp i18n make-pot wp-content/plugins/hello-world wp-content/plugins/hello-world/languages/hello-world.pot`
110-
Then the wp-content/plugins/hello-world/languages/hello-world.pot file should contain:
111-
"""
112-
# Copyright (C) {YEAR} YOUR NAME HERE
113-
# This file is distributed under the same license as the Hello World plugin.
114-
"""
115-
116-
@require-windows
117102
Scenario: Adds copyright comments
118103
When I run `wp scaffold plugin hello-world`
119-
And I run `get-date -f yyyy`
104+
And I run `php -r "echo date('Y');"`
120105
Then STDOUT should not be empty
121106
And save STDOUT as {YEAR}
122107

@@ -593,7 +578,7 @@ Feature: Generate a POT file of a WordPress project
593578
"""
594579

595580
Scenario: Extract translator comments
596-
Given I run `echo "\t"`
581+
Given I run `php -r "echo \"\t\";"`
597582
And save STDOUT as {TAB}
598583
And an empty foo-plugin directory
599584
And a foo-plugin/foo-plugin.php file:
@@ -1185,6 +1170,12 @@ Feature: Generate a POT file of a WordPress project
11851170
I am not being ignored either
11861171
"""
11871172

1173+
# Skipped on Windows because the `--exclude="/myvendor/,/ignored.php"` argument
1174+
# relies on forward-slash path matching, which does not behave as expected with
1175+
# Windows backslash directory separators. On Windows, `foo-plugin/myvendor/foo.php`
1176+
# and `foo-plugin/ignored.php` are not excluded correctly and their strings still
1177+
# appear in the generated POT file, causing this scenario's assertions to fail.
1178+
@skip-windows
11881179
Scenario: Removes trailing and leading slashes of excluded paths
11891180
Given an empty foo-plugin directory
11901181
And a foo-plugin/foo-plugin.php file:
@@ -2654,7 +2645,7 @@ Feature: Generate a POT file of a WordPress project
26542645
__( 'Hello World', 'foo-plugin' );
26552646
"""
26562647

2657-
When I run `wp eval "echo DIRECTORY_SEPARATOR;"`
2648+
When I run `php -r "echo DIRECTORY_SEPARATOR;"`
26582649
And save STDOUT as {DIRECTORY_SEPARATOR}
26592650

26602651
And I try `wp i18n make-pot foo-plugin --debug`
@@ -2727,7 +2718,7 @@ Feature: Generate a POT file of a WordPress project
27272718
*/
27282719
"""
27292720

2730-
When I run `wp eval "echo DIRECTORY_SEPARATOR;"`
2721+
When I run `php -r "echo DIRECTORY_SEPARATOR;"`
27312722
And save STDOUT as {DIRECTORY_SEPARATOR}
27322723

27332724
And I try `wp i18n make-pot foo-theme --debug`

0 commit comments

Comments
 (0)