dox Executable Documentation

watoki-scrut

specification

Specification

Run all tests

Given the class definition ' class RunAllTest extends \\watoki\\scrut\\Specification { function testFoo() { spec\\watoki\\scrut\\specification\\SpecificationTest::$run++; } function testBar() { spec\\watoki\\scrut\\specification\\SpecificationTest::$run++; } } '
When I run the test 'RunAllTest'
Then 2 tests should have run

Run failing tests

Given the class definition ' class RunFailingTest extends \\watoki\\scrut\\Specification { function testFoo() { $this->fail(); spec\\watoki\\scrut\\specification\\SpecificationTest::$run++; } function testBar() { spec\\watoki\\scrut\\specification\\SpecificationTest::$run++; } } '
When I run the test 'RunFailingTest'
Then 1 tests should have run
Then the result should contain 1 failed test

Undos

Given the class definition ' class UndoTest extends \\watoki\\scrut\\Specification { function testFooBar() { $this->undos[] = function () { spec\\watoki\\scrut\\specification\\SpecificationTest::$run--; }; } } '
When I run the test 'UndoTest'
Then -1 tests should have run

then_TestsShouldHaveRun

$this->assertEquals($int, self::$run);