Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[feature] Matcher for throwException #12

@ghost

Description

When passing a closure to $this->spec(), a PHPSpec\Specification\Exception object is created in which you can use PHPSpec DSL

    function itShouldComplainWhenNotEmptyAndNoNumbersAreGiven() {
        $this->spec(function () {
             $this-calculator("dfsdf")
         })->should->throwException('InvalidArgumentException', 'No numbers given');
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions