Test::Run::Plugin::ColorFileVerdicts::ColorBase - common functionality


Test-Run-Plugin-ColorFileVerdicts documentation Contained in the Test-Run-Plugin-ColorFileVerdicts distribution.

Index


Code Index:

NAME

Top

Test::Run::Plugin::ColorFileVerdicts::ColorBase - common functionality that deals with the color fields for both the main object and the CanonFailedObj.

DESCRIPTION

Top

For internal use.

AUTHOR

Top

Shlomi Fish, <shlomif at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-test-run-plugin-colorfileverdicts at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Run-Plugin-ColorFileVerdicts. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Test::Run::Plugin::ColorFileVerdicts::ColorBase

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Test-Run-Plugin-ColorFileVerdicts

* CPAN Ratings

http://cpanratings.perl.org/d/Test-Run-Plugin-ColorFileVerdicts

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Run-Plugin-ColorFileVerdicts

* Search CPAN

http://search.cpan.org/dist/Test-Run-Plugin-ColorFileVerdicts

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Test-Run-Plugin-ColorFileVerdicts documentation Contained in the Test-Run-Plugin-ColorFileVerdicts distribution.
package Test::Run::Plugin::ColorFileVerdicts::ColorBase;

use strict;
use warnings;

sub _get_individual_test_file_verdict_user_set_color
{
    my ($self, $event) = @_;

    return $self->individual_test_file_verdict_colors() ?
        $self->individual_test_file_verdict_colors()->{$event} :
        undef;
}

sub _get_individual_test_file_color
{
    my ($self, $event) = @_;

    return $self->_get_individual_test_file_verdict_user_set_color($event)
        || $self->_get_default_individual_test_file_verdict_color($event);
            
}

sub _get_default_individual_test_file_verdict_color
{
    my ($self, $event) = @_;

    my %mapping =
    (
        "success" => "green",
        "failure" => "red",
        "dubious" => "red",
    );
    return $mapping{$event};
}


1;