Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #24 from franmomu/fix/output_coverage_by_default
Browse files Browse the repository at this point in the history
Fixed output html by default
  • Loading branch information
henrikbjorn committed Jul 4, 2014
2 parents 11afc5b + b5d7ca6 commit 987be21
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions spec/PhpSpec/Extension/Listener/CodeCoverageListenerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,30 @@ function it_should_output_text_report(

$this->afterSuite($event);
}

function it_should_output_html_report(
\PHP_CodeCoverage $coverage,
\PHP_CodeCoverage_Report_HTML $html,
SuiteEvent $event,
IO $io
) {
$reports = array(
'html' => $html
);

$this->beConstructedWith($coverage, $reports);
$this->setOptions(array(
'format' => 'html',
'output' => array('html' => 'coverage'),
));

$io->isVerbose()->willReturn(false);
$this->setIO($io);

$io->writeln('Generating code coverage report in html format ...')->shouldBeCalled();

$html->process($coverage, 'coverage')->willReturn('report');

$this->afterSuite($event);
}
}
2 changes: 1 addition & 1 deletion src/PhpSpec/Extension/Listener/CodeCoverageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(\PHP_CodeCoverage $coverage, array $reports)
'blacklist' => array('vendor', 'spec'),
'whitelist_files' => array(),
'blacklist_files' => array(),
'output' => 'coverage',
'output' => array('html' => 'coverage'),
'format' => array('html'),
);
}
Expand Down

0 comments on commit 987be21

Please sign in to comment.