Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Latest commit

 

History

History
54 lines (39 loc) · 1.63 KB

README.md

File metadata and controls

54 lines (39 loc) · 1.63 KB

PhpSpec Skip Example Extension

This PhpSpec extension allows to skip example through user-friendly annotations. Run Tests

Installation

Once you have installed PhpSpec (following the documentation on the official website), you can install this extension using the following Composer command:

composer require babdev/phpspec-skip-example-extension

Configuration

You can now activate the extension by creating a phpspec.yml file at the root of your project:

extensions:
    Akeneo\SkipExampleExtension: ~

Usage

@require

The @require annotation can be used on the spec class or any example method. If a requirement is missing from the spec, all examples will be skipped. If a requirement is missing from an example, only that example will be skipped.

/**
 * @require Vendor\Builder\ToolInterface
 */
class BridgeBuilderSpec extends ObjectBehavior
{
    // Will be skipped if the Vendor\Builder\ToolInterface interface does not exist
    function it_builds_a_bridge()
    {
    }

    /**
     * @require Vendor\Builder\ConcreteTruck
     */
    // Will be skipped if the Vendor\Builder\ToolInterface interface or Vendor\Builder\ConcreteTruck class does not exist
    function it_builds_the_road()
    {
    }

    //...
}

Contributions

Feel free to contribute to this extension if you find some interesting ways to improve it!