File: xml.t

package info (click to toggle)
libconfig-auto-perl 0.20-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 144 kB
  • ctags: 20
  • sloc: perl: 266; makefile: 43; xml: 9
file content (25 lines) | stat: -rw-r--r-- 638 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
use Test::More;

use strict;
use warnings;
no warnings qw(once);

use File::Spec::Functions;

BEGIN {
  eval "use XML::Simple";

  plan skip_all => "XML::Simple required to test XML formatted configs" if $@;
  plan tests => 6;
}

use_ok('Config::Auto');

my $config=Config::Auto::parse('config.xml',path => catdir('t','config'));

is($Config::Auto::Format,'xml','Config file is XML');
is(ref $config->{main},'HASH','Parent element config');
is($config->{main}{title},'test blocks','Child element option');
is($config->{main}{name},'Tests & Failures','XML encoding');
is($config->{urlreader}{start},'home.html','Element with attribute');