App-jupiter

 view release on metacpan or  search on metacpan

t/atom.t  view on Meta::CPAN

stop_daemon();

Jupiter::make_html("test-$id/rss2sample.html", "test-$id/rss2sample.xml", "test-$id/rss2sample.opml");

my $doc = XML::LibXML->load_html(location => "test-$id/rss2sample.html");
is($doc->findvalue('//h1'), "Planet", "HTML title");
is($doc->findvalue('//div[@class="post"][position()=1]/h3'), "dive into mark — Atom draft-07 snapshot", "Entry title");
is($doc->findvalue('//div[@class="post"][position()=1]/div[@class="content"]'), "[Update: The Atom draft is finished.]", "Entry content");

$doc = XML::LibXML->load_xml(location => "test-$id/rss2sample.xml");
is($doc->findvalue('//item[position()=1]/title'), "Atom draft-07 snapshot", "XHTML Item title");
my @nodes = $doc->findnodes('//item[position()=1]/description');
my $node = shift(@nodes);
like($node->toString, qr(<p><i>\[Update: The Atom draft is finished\.\]</i></p>),
     "XHTML Item description");

is($doc->findvalue('//item[position()=2]/title'), "HTML Example", "HTML Item title");
@nodes = $doc->findnodes('//item[position()=2]/description');
$node = shift(@nodes);
like($node->toString, qr(<p><i>Yeah!</i></p>),
     "HTML Item description");

done_testing();



( run in 0.444 second using v1.01-cache-2.11-cpan-49f99fa48dc )