Skip to content

Commit

Permalink
Merge pull request #37 from bmitch/commandTest
Browse files Browse the repository at this point in the history
Command test
  • Loading branch information
bmitch authored Jun 23, 2017
2 parents 0308ca6 + 681651b commit a795aaa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Commands/ChurnCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ChurnCommand extends Command
public function __construct()
{
parent::__construct();
$commitCountAssessor = new GitCommitCountAssessor(new CommandService);
$commitCountAssessor = new GitCommitCountAssessor(new CommandService);
$complexityAssessor = new CyclomaticComplexityAssessor();
$this->resultsGenerator = new ResultsGenerator($commitCountAssessor, $complexityAssessor);
$this->fileManager = new FileManager;
Expand Down
17 changes: 17 additions & 0 deletions tests/Unit/Services/CommandServiceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types = 1);

namespace Churn\Tests\Results;

use Churn\Tests\BaseTestCase;
use Churn\Services\CommandService;

class CommandServiceTest extends BaseTestCase
{
/** @test */
public function it_returns_the_output_of_a_command()
{
$commandService = new CommandService;
$result = $commandService->execute("echo hi");
$this->assertSame(["hi"], $result);
}
}

0 comments on commit a795aaa

Please sign in to comment.