davedevelopment/montserrat

Behat 的 CLI 扩展

安装: 116

依赖者: 1

建议者: 0

安全性: 0

星标: 3

关注者: 2

分支: 0

开放问题: 0

类型:behat-extension

dev-master 2012-07-04 10:00 UTC

This package is auto-updated.

Last update: 2024-09-06 10:35:56 UTC


README

Build Status

这是什么?

Montserrat 是 Behat 的扩展,就像 Aruba 是 Cucumber 的扩展一样。它是一个用于任何编程语言编写的命令行应用程序的扩展。我将持续尝试添加尽可能多的 aruba 功能。

安装

安装 montserrat 的唯一官方方式是使用 composer

$ composer.phar require --dev davedevelopment/montserrat:* 

使用方法

将扩展添加到您的 behat.yml 文件

default:
    extensions:
        Behat\Montserrat\Extension:

在您的 FeatureContext 构造函数中,添加 montserrat 作为上下文(即将推出 traits)

<?php
    public function __construct(array $parameters)
    {
        $this->useContext('montserrat', new Behat\Montserrat\Context\MontserratContext());
    }

编写您的功能

Feature: ls
    In order to examine files in directory
    As a terminal user
    I need to list the files

    Scenario: ls shows files
        Given an empty file named "foo/bar"
        When I run `ls foo`
        Then the output should contain "bar"

要查看可用的步骤的完整列表,请参阅 features 文件或使用 behat 的 -dl 开关

$ vendor/bin/behat -dl

贡献

将其分支,查看 Aruba 的实现方式,实现它,并通过拉取请求为公益事业贡献力量。

版权

版权所有 © 2012 Dave Marshall。有关详细信息,请参阅 LICENCE。