X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F11-xml-base-rss.t;h=6efcdcb394a59b3562874ad602e4524d4150d896;hb=7c89ffffd73b52800d3b954e81765d9f0133a57f;hp=2cba3ca0f6634ff24abd41844bb1badd089899e8;hpb=5383a560216d4dca563f8fed955429e2838fea57;p=catagits%2FXML-Feed.git diff --git a/t/11-xml-base-rss.t b/t/11-xml-base-rss.t index 2cba3ca..6efcdcb 100644 --- a/t/11-xml-base-rss.t +++ b/t/11-xml-base-rss.t @@ -1,14 +1,33 @@ # $Id: $ use strict; -#use Test::More tests => 3; -use Test::More skip_all => "xml:base support not available in XML::RSS yet"; +use Test::More tests => 13; use XML::Feed; my $feed = XML::Feed->parse('t/samples/base_rss.xml'); my ($entry) = $feed->entries; my $content = $entry->content; -is($feed->base, "http://example.org/", "Got feed base"); -is($entry->base, "http://example.org/archives/", "Got entry base"); -is($content->base, "http://example.org/archives/000001.html", "Got content base"); +is($feed->base, "http://example.org/", "Got feed base"); +is($entry->base, "http://example.org/archives/", "Got entry base"); +is($content->base, "http://example.org/archives/000001.html", "Got content base"); + +my $xml = $feed->as_xml; +my $new; +ok($new = XML::Feed->parse(\$xml), "Parsed old feed"); +my ($new_entry) = $new->entries; +my $new_content = $entry->content; +is($new->base, "http://example.org/", "Got feed base"); +is($new_entry->base, "http://example.org/archives/", "Got entry base"); +is($new_content->base, "http://example.org/archives/000001.html", "Got content base"); + + +ok($feed->base("http://foo.com/"), "Set feed base"); +ok($entry->base("http://foo.com/archives/"), "Set entry base"); +ok($content->base("http://foo.com/archives/000001.html"), "Set content base"); + +is($feed->base, "http://foo.com/", "Got feed base"); +is($entry->base, "http://foo.com/archives/", "Got entry base"); +is($content->base, "http://foo.com/archives/000001.html", "Got content base"); + +