~duncan-bayne/halp

bf76014fa28f07d121466ae281e3f9d42bb5abba — Duncan Bayne 6 months ago da05c59
Start writing some unit tests for the AtomFeed module
2 files changed, 20 insertions(+), 0 deletions(-)

A t/Halp/atom_feed_test.t
A t/fixtures/atom_feed/.title
A t/Halp/atom_feed_test.t => t/Halp/atom_feed_test.t +19 -0
@@ 0,0 1,19 @@
use Cwd;
use lib cwd() . "/lib";

use strict;
use warnings;

use Halp::AtomFeed;
use Mojo::DOM;
use Test::More;

use Test::More tests => 1;

my $feed = feed_for('/atom_feed/feed.xml', './t/fixtures/atom_feed/feed.xml', '.', 'example.com', {email => 'author@example.com', name => 'An Author'});
my $xml = Mojo::DOM->new->xml(1)->parse($feed);

like($xml->at('feed')->at('title')->text, qr/^Test Title$/, 'The Atom feed has the correct title.');

exit(0);


A t/fixtures/atom_feed/.title => t/fixtures/atom_feed/.title +1 -0
@@ 0,0 1,1 @@
Test Title