Skip to content

Commit

Permalink
Tests that render calls uses writer
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Jan 31, 2018
1 parent bf71447 commit d013a6a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Unit/Adapters/PhpunitTest.php
Expand Up @@ -20,6 +20,15 @@ public function it_respects_is_contract(): void
$this->assertInstanceOf(\NunoMaduro\Collision\Contracts\Adapters\Phpunit\Listener::class, new Listener());
}

/** @test */
public function it_renders_exceptions_using_the_writer(): void
{
$writerMock = $this->createMock(Writer::class);
$exception = new FakeException();
$writerMock->expects($this->once())->method('write')->with(new Inspector($exception));
(new Listener($writerMock))->render($exception);
}

/** @test */
public function it_adds_an_error(): void
{
Expand Down Expand Up @@ -58,6 +67,7 @@ public function it_dont_renders_nothing_on_test_suite_methods(): void
$listenerMock->expects($this->never())->method('render');
$listenerMock->startTestSuite($testSuite);
$listenerMock->endTestSuite($testSuite);
$listenerMock->startTest($testSuite);
$listenerMock->endTest($testSuite, 0);
}

Expand Down

0 comments on commit d013a6a

Please sign in to comment.