2019-03-19 23:44:10 +03:00
|
|
|
use lib 'lib';
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use Test::More;
|
|
|
|
use Test::Fatal;
|
|
|
|
use File::Temp;
|
|
|
|
use Log::Mini;
|
|
|
|
|
|
|
|
|
2023-03-17 18:29:38 +03:00
|
|
|
subtest 'creates correct object Logger::FILE' => sub {
|
2019-03-19 23:44:10 +03:00
|
|
|
my $file = File::Temp->new;
|
2023-03-17 18:29:38 +03:00
|
|
|
isa_ok(Log::Mini->new(file => $file->filename), 'Log::Mini::Logger::FILE');
|
|
|
|
isa_ok(Log::Mini::Logger::FILE->new(file => $file->filename), 'Log::Mini::Logger::FILE');
|
|
|
|
};
|
|
|
|
|
|
|
|
subtest 'creates correct object Logger::STDERR' => sub {
|
|
|
|
isa_ok(Log::Mini->new('stderr', level => 'debug'), 'Log::Mini::Logger::STDERR');
|
|
|
|
isa_ok(Log::Mini::Logger::STDERR->new(level => 'debug'), 'Log::Mini::Logger::STDERR');
|
2019-03-19 23:44:10 +03:00
|
|
|
};
|
|
|
|
|
2023-03-17 18:29:38 +03:00
|
|
|
subtest 'creates correct object Logger::NULL' => sub {
|
|
|
|
isa_ok(Log::Mini->new('null', level => 'debug'), 'Log::Mini::Logger::NULL');
|
|
|
|
isa_ok(Log::Mini::Logger::NULL->new(level => 'debug'), 'Log::Mini::Logger::NULL');
|
2019-03-19 23:44:10 +03:00
|
|
|
};
|
|
|
|
|
2023-03-17 18:29:38 +03:00
|
|
|
done_testing;
|