App-LogStats
view release on metacpan or search on metacpan
{
my $stats = App::LogStats->new;
isa_ok($stats, 'App::LogStats');
stdout_is { $stats->run; } '', 'just run';
}
{
my $stats = App::LogStats->new;
throws_ok {
$stats->run('_no_exists_file_');
} qr/^_no_exists_file_: No such file/, 'no_exists_file';
}
test_stats('');
test_stats(<<'_TXT_', 'share/log1');
--------- ------
1
t/08_help.t view on Meta::CPAN
{
# mock
no warnings 'redefine'; ## no critic
*Pod::Usage::pod2usage = sub {
die "called pod2usage";
};
}
{
my $stats = App::LogStats->new;
throws_ok {
$stats->run('--help');
} qr/^called pod2usage/, 'help';
}
done_testing;
t/09_wrong_option.t view on Meta::CPAN
{
# mock
no warnings 'redefine'; ## no critic
*Pod::Usage::pod2usage = sub {
die "called pod2usage";
};
}
{
my $stats = App::LogStats->new;
throws_ok {
$stats->run('--this-is-no-exists-option');
} qr/^called pod2usage/, 'help';
}
done_testing;
( run in 0.253 second using v1.01-cache-2.11-cpan-496ff517765 )