File: 30-hashref.t

package info (click to toggle)
liblog-dispatch-configurator-any-perl 1.110690-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 156 kB
  • sloc: perl: 96; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 593 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use Test::More tests => 2;

use Log::Dispatch::Config;
use Log::Dispatch::Configurator::Any;

my $defaults = {
    dispatchers => ['screen'],
    screen => {
        class     => 'Log::Dispatch::Screen',
        min_level => 'debug',
        max_level => 'emergency',
        stderr    => 0,
    },
};

my $config  = Log::Dispatch::Configurator::Any->new($defaults);
isa_ok($config, 'Log::Dispatch::Configurator::Any');

Log::Dispatch::Config->configure($config);

{
    my $disp = Log::Dispatch::Config->instance;
    isa_ok $disp->{outputs}->{screen}, 'Log::Dispatch::Screen';
}