expect/peridot-expect-plugin

Expectation for peridot

4.0.0 2016-08-10 03:31 UTC

This package is auto-updated.

Last update: 2024-10-15 15:25:39 UTC


README

Expectation for peridot

Latest Stable Version Latest Unstable Version Dependency Status Build Status HHVM Status Scrutinizer Code Quality Coverage Status Stories in Ready

Installation

Installation that uses the composer

Please add the following items to composer.json.
Then please run the composer install.

{
    "require-dev": {
        "expectation/peridot-expect-plugin": "3.0.0"
    }
}

Basic usage

It can be used by simply append the set to peridot.php.

use expect\peridot\ExpectPlugin;

return function(EventEmitterInterface $emitter) {
    ExpectPlugin::create()->registerTo($emitter);
};

or

How to configure can be found here.

use expect\peridot\ExpectPlugin;

return function(EventEmitterInterface $emitter) {
    ExpectPlugin::createWithConfig('.expect.toml')->registerTo($emitter);
};

Examples of spec

You can easily use in the spec file.

describe('Example', function() {
    describe('#create', function() {
        it('return instance', function() {
            expect(Example::create())->toBeAnInstanceOf('Example')
        });
    });
});