Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions features/scaffold-plugin-tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,7 @@ Feature: Scaffold plugin unit tests
Then the {RUN_DIR}/wp-content/plugins/foo.php file should exist

When I try `wp scaffold plugin-tests foo`
Then STDERR should be:
"""
Error: Invalid plugin slug specified. No such target directory '{RUN_DIR}/wp-content/plugins/foo'.
"""
Then STDERR should match #Error: Invalid plugin slug specified\. No such target directory '.*wp-content/plugins/foo'\.#
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The regex uses hardcoded forward slashes (/) in the path wp-content/plugins/foo. On Windows, these separators are typically backslashes, which will cause the test to fail. Since this pull request is intended to improve Windows compatibility, the regex should be more flexible. Simplifying it to .*foo (matching the style used on line 271) would resolve this and maintain consistency across the test suite.

    Then STDERR should match #Error: Invalid plugin slug specified\. No such target directory '.*foo'\.#

And the return code should be 1

When I try `wp scaffold plugin-tests .`
Expand Down Expand Up @@ -271,10 +268,7 @@ Feature: Scaffold plugin unit tests
When I run `rm -rf {PLUGIN_DIR} && touch {PLUGIN_DIR}`
Then the return code should be 0
When I try `wp scaffold plugin-tests hello-world`
Then STDERR should be:
"""
Error: Invalid plugin slug specified. No such target directory '{PLUGIN_DIR}'.
"""
Then STDERR should match #Error: Invalid plugin slug specified\. No such target directory '.*hello-world'\.#
And the return code should be 1

Scenario: Scaffold plugin tests with a symbolic link
Expand Down
Loading