Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
Remove mock
Browse files Browse the repository at this point in the history
  • Loading branch information
holyshared committed Aug 31, 2014
1 parent 953f8a8 commit d332430
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions spec/ConfigurationSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace coverallskit\spec;

use coverallskit\Configuration;
use Prophecy\Prophet;
use coverallskit\ReportBuilder;
use Prophecy\Argument;
use Zend\Config\Config;

Expand Down Expand Up @@ -60,10 +60,12 @@

describe('applyTo', function() {
before(function() {
$this->prophet = new Prophet();

$config = new Config([
'reportFile' => [
'input' => [
'type' => 'clover',
'file' => 'clover.xml'
],
'output' => 'coveralls.json'
],
'token' => 'api-token',
Expand All @@ -73,21 +75,19 @@

$this->configration = new Configuration($config);

$builder = $this->prophet->prophesize('\coverallskit\ReportBuilderInterface');
$builder->reportFilePath(getcwd() . '/coveralls.json')->willReturn($builder);
$builder->token('api-token')->willReturn($builder);
$builder->service(Argument::type('coverallskit\entity\service\ServiceInterface'))->willReturn($builder);
$builder->repository(Argument::type('coverallskit\entity\RepositoryInterface'))->willReturn($builder);

$builder->build()->shouldNotBeCalled();
$this->builder = new ReportBuilder();
$this->configration->applyTo($this->builder);

$this->builder = $builder->reveal();
$this->report = $this->builder->build();
});
after(function() {
$this->prophet->checkPredictions();
it('apply report name config', function() {
expect($this->report->name)->toEqual(realpath(__DIR__ . '/../') . '/coveralls.json');
});
it('should apply configration', function() {
$this->configration->applyTo($this->builder);
it('apply service config', function() {
expect($this->report->service)->toBeAnInstanceOf('coverallskit\entity\service\ServiceInterface');
});
it('apply repository config', function() {
expect($this->report->repository)->toBeAnInstanceOf('coverallskit\entity\RepositoryInterface');
});
});

Expand Down

0 comments on commit d332430

Please sign in to comment.