File: 15_appconfig.t

package info (click to toggle)
liblog-dispatch-config-perl 1.04-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 224 kB
  • sloc: perl: 233; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (2)
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
26
27
28
29
use strict;
use Test::More tests => 3;

use AppConfig;
use Log::Dispatch::Configurator::AppConfig;
use Log::Dispatch::Config;

END { unlink "t/log.out" if -e "t/log.out" }

my $cfg_file = 't/section.ini';
ok(-f $cfg_file, "Config exists");

my $appconf = AppConfig->new({
    CREATE => 1,
    GLOBAL => {
	ARGCOUNT => AppConfig::ARGCOUNT_ONE(),
    },
});
$appconf->file($cfg_file);

my $config  = Log::Dispatch::Configurator::AppConfig->new($appconf, 'log');
isa_ok($config, 'Log::Dispatch::Configurator::AppConfig');

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

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