Permalink
Browse files

Fix a bad method call in `console\Command::header()`. Heading style w…

…as ignored
  • Loading branch information...
1 parent fa8deef commit d506b62479b91a9ec19c8220e7151ad07c9c1b60 @mehlah mehlah committed May 12, 2013
Showing with 11 additions and 1 deletion.
  1. +1 −1 console/Command.php
  2. +10 −0 tests/cases/console/ResponseTest.php
View
@@ -261,7 +261,7 @@ public function header($text, $line = null) {
$line = strlen($text);
}
$this->hr($line);
- $this->out($text, 1, 'heading');
+ $this->out($text, 'heading');
$this->hr($line);
}
@@ -70,6 +70,16 @@ public function testOutput() {
$this->assertEqual('ok', file_get_contents($this->streams['output']));
}
+ public function testStyledOutput() {
+ $base = Libraries::get(true, 'resources') . '/tmp/tests';
+ $this->skipIf(!is_writable($base), "Path `{$base}` is not writable.");
+
+ $response = new Response(array('output' => fopen($this->streams['output'], 'w+')));
+ $response->styles(array('heading' => "\033[1;36m"));
+ $response->output('{:heading}ok');
+ $this->assertEqual("\033[1;36mok", file_get_contents($this->streams['output']));
+ }
+
public function testError() {
$base = Libraries::get(true, 'resources') . '/tmp/tests';
$this->skipIf(!is_writable($base), "Path `{$base}` is not writable.");

0 comments on commit d506b62

Please sign in to comment.