Skip to content

Commit

Permalink
add src and spec dir information into terminal (#242)
Browse files Browse the repository at this point in the history
* add src and spec dir information into terminal
  • Loading branch information
samsonasik authored and jails committed May 7, 2017
1 parent 671ddac commit 46b558a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Cli/Kahlan.php
Expand Up @@ -508,7 +508,9 @@ protected function _console()
$params = $args + [
'start' => $this->_start,
'colors' => !$this->commandLine()->get('no-colors'),
'header' => !$this->commandLine()->get('no-header')
'header' => !$this->commandLine()->get('no-header'),
'src' => $this->commandLine()->get('src'),
'spec' => $this->commandLine()->get('spec'),
];

if (isset($output) && strlen($output) > 0) {
Expand Down
29 changes: 28 additions & 1 deletion src/Reporter/Terminal.php
Expand Up @@ -67,6 +67,21 @@ class Terminal extends Reporter
'dot' => '.'
];


/**
* src directory to be tested.
*
* @var array
*/
protected $_srcDir = ['src'];

/**
* spec directory.
*
* @var array
*/
protected $_specDir = ['spec'];

/**
* The constructor.
*
Expand Down Expand Up @@ -94,6 +109,14 @@ public function __construct($config = [])
$this->_symbols['err'] = "\x78";
$this->_symbols['dot'] = '.';
}

if (isset($config['src'])) {
$this->_srcDir = $config['src'];
}

if (isset($config['spec'])) {
$this->_specDir = $config['spec'];
}
}

/**
Expand Down Expand Up @@ -133,8 +156,12 @@ public function start($args)
}
$this->write($this->kahlan() . "\n\n");
$this->write($this->kahlanBaseline() . "\n", 'dark-grey');
$this->write("\nWorking Directory: ", 'blue');
$this->write("\nWorking Directory : ", 'blue');
$this->write(getcwd() . "\n");
$this->write("src Directory : ", 'blue');
$this->write(join(', ', array_map('realpath', $this->_srcDir)) . "\n");
$this->write("spec Directory : ", 'blue');
$this->write(join(', ', array_map('realpath', $this->_specDir)) . "\n");
}

/**
Expand Down

0 comments on commit 46b558a

Please sign in to comment.