Back to Colouring...
- Now we can write this plugin:
package Test::Run::Plugin::ColorSummary;
use warnings;
use strict;
use NEXT;
use Term::ANSIColor;
sub _report_success
{
my $self = shift;
print color("bold blue");
$self->NEXT::_report_success();
print color("reset");
}
sub _handle_runtests_error
{
my $self = shift;
my (%args) = @_;
my $error = $args{'error'};
print STDERR color("bold red");
print STDERR $error;
print STDERR color("reset");
# Workaround to make sure color("reset") is accepted and a red cursor
# is not displayed.
print STDERR "\n";
}
1;