From bf7e3a0314441b0e6743906c2ae7e5fc854e1a00 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 30 Mar 2026 10:04:47 +0200 Subject: [PATCH] Use regex matcher in test Fixes a macOS-specific failure caused by `/var` vs `/private/var` path expansion --- features/scaffold-plugin-tests.feature | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/features/scaffold-plugin-tests.feature b/features/scaffold-plugin-tests.feature index 2b73991e..0001a65b 100644 --- a/features/scaffold-plugin-tests.feature +++ b/features/scaffold-plugin-tests.feature @@ -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'\.# And the return code should be 1 When I try `wp scaffold plugin-tests .` @@ -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