Changed contact details from non-working 6A email address.
[catagits/XML-Feed.git] / t / 11-xml-base-rss.t
CommitLineData
3353d70c 1# $Id$
5383a560 2
3use strict;
e3b96b9c 4use Test::More;
5383a560 5use XML::Feed;
e3b96b9c 6use XML::RSS;
5383a560 7
f62087b4 8plan tests => 13;
5383a560 9
10my $feed = XML::Feed->parse('t/samples/base_rss.xml');
e3b96b9c 11
5383a560 12my ($entry) = $feed->entries;
13my $content = $entry->content;
7c89ffff 14is($feed->base, "http://example.org/", "Got feed base");
15is($entry->base, "http://example.org/archives/", "Got entry base");
16is($content->base, "http://example.org/archives/000001.html", "Got content base");
17
18my $xml = $feed->as_xml;
19my $new;
20ok($new = XML::Feed->parse(\$xml), "Parsed old feed");
21my ($new_entry) = $new->entries;
22my $new_content = $entry->content;
23is($new->base, "http://example.org/", "Got feed base");
24is($new_entry->base, "http://example.org/archives/", "Got entry base");
25is($new_content->base, "http://example.org/archives/000001.html", "Got content base");
26
27
28ok($feed->base("http://foo.com/"), "Set feed base");
29ok($entry->base("http://foo.com/archives/"), "Set entry base");
30ok($content->base("http://foo.com/archives/000001.html"), "Set content base");
31
32is($feed->base, "http://foo.com/", "Got feed base");
33is($entry->base, "http://foo.com/archives/", "Got entry base");
34is($content->base, "http://foo.com/archives/000001.html", "Got content base");
35
36