File: 200.XmlClean.t

package info (click to toggle)
publican 4.3.2-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,436 kB
  • sloc: javascript: 17,390; perl: 13,081; xml: 11,558; makefile: 160; sh: 60; python: 29
file content (40 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (5)
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
30
31
32
33
34
35
36
37
38
39
40
use strict;
use warnings;

use Test::More tests => 5;
use File::pushd;
use Cwd qw(abs_path);

BEGIN {
    use_ok('Publican');
    use_ok('Publican::XmlClean');
}

my $dir = pushd("Test_Book");

my $publican = Publican->new(
    {   debug          => 1,
        configfile     => 'publican.cfg',
        NOCOLOURS      => 1,
    }
);

my $cleaner = Publican::XmlClean->new( { clean_id => 1 } );
isa_ok( $cleaner, 'Publican::XmlClean', 'creating a Publican::XmlClean' );

eval {
    $cleaner->process_file(
        { file => 'en-US/Book_Info.xml', out_file => 'en-US/Book_Info.xml' }
    );
};
my $e = $@;
ok( ( not $e ), "clean ids for a book" );
diag($e) if $e;

eval { $cleaner->print_known_tags() };
$e = $@;
ok( ( not $e ), "print_known_tags" );
diag($e) if $e;

$dir = undef;