期望 STDOUT 为包含特定值的 CSV。
用法
场景:我的示例场景
当我运行 `wp term list post_tag --fields=name,slug --format=csv`
那么 STDOUT 应为包含以下内容的 CSV:
| name | slug |
| Test term | test |
Behat 步骤文档会在每次发布时根据 WP-CLIWP-CLI WP-CLI 是 WordPress 的命令行界面,用于以编程方式执行管理和开发任务。项目页面:http://wp-cli.org/ https://make.wordpress.org/cli/ 代码库生成。如有改进建议,请提交拉取请求。
相关内容
- Then /^the return code should( not)? be (\d+)$/ – 期望上一个命令返回特定的退出代码。
- Then /^(STDOUT|STDERR) should( strictly)? (be|contain|not contain):$/ – 检查 STDOUT 或 STDERR 的内容。
- Then /^(STDOUT|STDERR) should be a number$/ – 期望 STDOUT 或 STDERR 为数值。
- Then /^(STDOUT|STDERR) should not be a number$/ – 期望 STDOUT 或 STDERR 不为数值。
- Then /^STDOUT should be a table containing rows:$/ – 期望 STDOUT 为包含指定行的表格。
- Then /^STDOUT should end with a table containing rows:$/ – 期望 STDOUT 以包含指定行的表格结尾。
- Then /^STDOUT should be JSON containing:$/ – 期望 STDOUT 中包含有效的 JSONJSON JSON(JavaScript 对象表示法)是一种简洁、易读的数据结构化格式,主要用于在服务器和 Web 应用程序之间传输数据,可作为 XML 的替代方案。 输出。
- Then /^STDOUT should be a JSON array containing:$/ – 期望 STDOUT 中包含有效的 JSON 数组输出。
- Then /^STDOUT should be YAML containing:$/ – 期望 STDOUT 为包含特定内容的 YAML。
- Then /^(STDOUT|STDERR) should be empty$/ – 期望 STDOUT 或 STDERR 为空。
- Then /^(STDOUT|STDERR) should not be empty$/ – 期望 STDOUT 或 STDERR 不为空。
- Then /^(STDOUT|STDERR) should be a version string (<|<=|>|>=|==|=|!=|<>) ([+\w.{}-]+)$/ – 期望 STDOUT 或 STDERR 为与给定版本进行比较的版本字符串。
- Then /^the (.+) (file|directory) should( strictly)? (exist|not exist|be:|contain:|not contain:)$/ – 期望指定文件或目录存在(或不存在),或者包含(或不包含)特定内容。
- Then /^the contents of the (.+) file should( not)? match (((\/.+\/)|(#.+#))(“,”+)?)$/ – 将文件内容与正则表达式进行匹配。[a-z]Then /^(STDOUT|STDERR) should( not)? match (((\/.+\/)|(#.+#))(“,”+)?)$/ – 将 STDOUT 或 STDERR 与正则表达式进行匹配。
- Then /^an email should (be sent|not be sent)$/ – 期望发送(或不发送)电子邮件。[a-z]Then the HTTP status code should be :code – 期望访问 `http://localhost:8080` 时返回指定的 HTTP 状态码。
- Then /^an email should (be sent|not be sent)$/ – Expect an email to be sent (or not).
- Then the HTTP status code should be :code – Expect the HTTP status code for visiting `http://localhost:8080`.