Skip to content

Commit

Permalink
Fix a few tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Feb 18, 2025
1 parent 8cdbf91 commit ad6ad0c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
16 changes: 13 additions & 3 deletions t/08_opml.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ use warnings;
use Test::More;
use FindBin qw($Bin);
use File::Temp qw(tempfile);
use YAML 'LoadFile';

use_ok('Perlanet::Simple');

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

my $cfg = LoadFile('testrc');
$cfg->{feeds} = [ map { Perlanet::Feed->new($_) } @{ $cfg->{feeds} } ];

my (undef, $opml_file) = tempfile(OPEN => 0);

$cfg->{opml_file} = $opml_file;
$cfg->{config} = $cfg;

ok(my $p = Perlanet::Simple->new($cfg),
'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->opml_file($opml_file);
$p->run();
$p->save_opml();
ok(-e $opml_file, 'OPML file created');
Expand Down
1 change: 1 addition & 0 deletions t/youtube2rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ feed:
format: Atom
feeds:
- feed: file:data/youtube.xml
title: YouTube Test
2 changes: 2 additions & 0 deletions t/youtuberc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ feed:
format: Atom
feeds:
- feed: file:data/youtube.xml
title: Test YouTube Feed

0 comments on commit ad6ad0c

Please sign in to comment.