Fix buglet to do with odd date terms
[catagits/XML-Feed.git] / t / 11-xml-base-rss.t
1 # $Id$
2
3 use strict;
4 use Test::More;
5 use XML::Feed;
6 use XML::RSS;
7
8 plan tests => 13;
9
10 my $feed    = XML::Feed->parse('t/samples/base_rss.xml');
11
12 my ($entry) = $feed->entries;
13 my $content = $entry->content;
14 is($feed->base,    "http://example.org/",                         "Got feed base");
15 is($entry->base,   "http://example.org/archives/",                "Got entry base");
16 is($content->base, "http://example.org/archives/000001.html",     "Got content base");
17
18 my $xml = $feed->as_xml;
19 my $new;
20 ok($new =  XML::Feed->parse(\$xml),                               "Parsed old feed");
21 my ($new_entry)  = $new->entries;
22 my $new_content  = $entry->content;
23 is($new->base,         "http://example.org/",                     "Got feed base");
24 is($new_entry->base,   "http://example.org/archives/",            "Got entry base");
25 is($new_content->base, "http://example.org/archives/000001.html", "Got content base");
26
27
28 ok($feed->base("http://foo.com/"),                                "Set feed base");
29 ok($entry->base("http://foo.com/archives/"),                      "Set entry base");
30 ok($content->base("http://foo.com/archives/000001.html"),         "Set content base");
31
32 is($feed->base,    "http://foo.com/",                             "Got feed base");
33 is($entry->base,   "http://foo.com/archives/",                    "Got entry base");
34 is($content->base, "http://foo.com/archives/000001.html",         "Got content base");
35
36