Skip to content

Commit 020f658

Browse files
committed
Add cache file creation step
1 parent 00c487c commit 020f658

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

features/steps/given.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ function ( $world ) {
4343
);
4444

4545
$steps->Given(
46-
'/^an? ([^\s]+) file:$/',
47-
function ( $world, $path, PyStringNode $content ) {
46+
'/^an? ([^\s]+) (file|cache file)?:$/',
47+
function ( $world, $path, $type, PyStringNode $content ) {
4848
$content = (string) $content . "\n";
49-
$full_path = $world->variables['RUN_DIR'] . "/$path";
49+
$full_path = 'cache file' === $type
50+
? $world->variables['SUITE_CACHE_DIR'] . "/$path"
51+
: $world->variables['RUN_DIR'] . "/$path";
5052
$dir = dirname( $full_path );
5153
if ( ! file_exists( $dir ) ) {
5254
mkdir( $dir, 0777, true /*recursive*/ );

0 commit comments

Comments
 (0)