Log-Mini/t/01_logger_builder.t
Denis Fedoseev bcbaf5e75d null logger
2019-04-12 01:01:37 +03:00

34 lines
No EOL
713 B
Perl

use lib 'lib';
use strict;
use warnings;
use Test::More;
use Test::Fatal;
use File::Temp;
use Log::Mini;
subtest 'creates stderr logger' => sub {
my $logger = Log::Mini->new('stderr');
isa_ok $logger, 'Log::Mini::LoggerSTDERR';
};
subtest 'creates null logger' => sub {
my $logger = Log::Mini->new('null');
isa_ok $logger, 'Log::Mini::LoggerNULL';
};
subtest 'creates file logger' => sub {
my $file = File::Temp->new;
my $logger = Log::Mini->new('file' => $file->filename);
isa_ok $logger, 'Log::Mini::LoggerFILE';
};
subtest 'return STDERR on unknown logger' => sub {
my $logger = Log::Mini->new('unknown');
isa_ok $logger, 'Log::Mini::LoggerSTDERR';
};
done_testing;