File: 08_opml.t

package info (click to toggle)
libperlanet-perl 2.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 444 kB
  • sloc: xml: 1,177; perl: 757; sh: 6; makefile: 5
file content (35 lines) | stat: -rw-r--r-- 680 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
30
31
32
33
34
35
use strict;
use warnings;
use Test::More;
use FindBin qw($Bin);
use File::Temp qw(tempfile);
use_ok('Perlanet::Simple');

chdir $Bin;
ok(my $p = Perlanet::Simple->new_with_config(configfile => 'testrc'),
   'Object created');
isa_ok($p,'Perlanet');

SKIP: {
  skip 'XML::OPML::SimpleGen not installed', 1 unless $p->has_opml;

  my (undef, $opml_file) = tempfile(OPEN => 0);
  $p->opml_file($opml_file);
  $p->run();
  $p->save_opml();
  ok(-e $opml_file, 'OPML file created');

  if (-e $p->opml_file) {
    unlink $p->opml_file;
  }

  if (-e $p->feed->{file}) {
    unlink $p->feed->{file};
  }

  if (-e $p->page->{file}) {
    unlink $p->page->{file};
  }
}

done_testing();