Skip to content

Commit 9451724

Browse files
authored
Merge pull request #99 from wp-cli/mention-behat-dl
Mention `behat -dl` as a useful way of seeing defined steps
2 parents 8cdca38 + 4929dd1 commit 9451724

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ WP-CLI `packages/local/` directory.
5252
[--require_wp_cli=<version>]
5353
Required WP-CLI version for the package.
5454
---
55-
default: >=1.1.0
55+
default: ^1.1.0
5656
---
5757

5858
[--skip-tests]
@@ -75,9 +75,9 @@ wp scaffold package-tests <dir> [--ci=<provider>] [--force]
7575
~~~
7676

7777
WP-CLI makes use of a Behat-based testing framework, which you should use
78-
too. Functional tests are an integral ingredient of highly-quality,
79-
maintainable commands. Behat is a great choice as a testing framework
80-
because:
78+
too. This command generates all of the files you need. Functional tests
79+
are an integral ingredient of high-quality, maintainable commands.
80+
Behat is a great choice as a testing framework because:
8181

8282
* It’s easy to write new tests, which means they’ll actually get written.
8383
* The tests interface with your command in the same manner as your users
@@ -106,8 +106,16 @@ Functional tests typically follow this pattern:
106106
* **When** a user performs a specific action,
107107
* **Then** the end result should be X (and Y and Z).
108108

109-
This command generates all of the files needed for you to write Behat
110-
tests for your own command. Specifically:
109+
View all defined Behat steps available for use with `behat -dl`:
110+
111+
```
112+
Given /^an empty directory$/
113+
Given /^an empty cache/
114+
Given /^an? ([^\s]+) file:$/
115+
Given /^"([^"]+)" replaced with "([^"]+)" in the ([^\s]+) file$/
116+
```
117+
118+
The files generated by this command include:
111119

112120
* `.travis.yml` is the configuration file for Travis CI.
113121
* `bin/install-package-tests.sh` will configure your environment to run

src/ScaffoldPackageCommand.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ public function package_readme( $args, $assoc_args ) {
370370
* Generate files needed for writing Behat tests for your command.
371371
*
372372
* WP-CLI makes use of a Behat-based testing framework, which you should use
373-
* too. Functional tests are an integral ingredient of highly-quality,
374-
* maintainable commands. Behat is a great choice as a testing framework
375-
* because:
373+
* too. This command generates all of the files you need. Functional tests
374+
* are an integral ingredient of high-quality, maintainable commands.
375+
* Behat is a great choice as a testing framework because:
376376
*
377377
* * It’s easy to write new tests, which means they’ll actually get written.
378378
* * The tests interface with your command in the same manner as your users
@@ -401,8 +401,16 @@ public function package_readme( $args, $assoc_args ) {
401401
* * **When** a user performs a specific action,
402402
* * **Then** the end result should be X (and Y and Z).
403403
*
404-
* This command generates all of the files needed for you to write Behat
405-
* tests for your own command. Specifically:
404+
* View all defined Behat steps available for use with `behat -dl`:
405+
*
406+
* ```
407+
* Given /^an empty directory$/
408+
* Given /^an empty cache/
409+
* Given /^an? ([^\s]+) file:$/
410+
* Given /^"([^"]+)" replaced with "([^"]+)" in the ([^\s]+) file$/
411+
* ```
412+
*
413+
* The files generated by this command include:
406414
*
407415
* * `.travis.yml` is the configuration file for Travis CI.
408416
* * `bin/install-package-tests.sh` will configure your environment to run

0 commit comments

Comments
 (0)