Changed contact details from non-working 6A email address.
[catagits/XML-Feed.git] / t / 09-missing-content-bug.t
1 #!perl -w
2
3 use strict;
4 use Test::More tests => 13;
5
6 use_ok("XML::Feed");
7
8
9 my $rss_feed;
10 ok($rss_feed = XML::Feed->new('RSS'),     "Got feed");
11 ok($rss_feed->title('Happy Feed'),        "Set feed title");
12 ok($rss_feed->author('Ask Bjork Tate'),   "Set feed author");
13 ok($rss_feed->link('http://nowhere.com'), "Set feed link");
14 ok($rss_feed->language('en-US'),          "Set feed language");
15 ok($rss_feed->description('not existing since who knows when'), "Set feed description");
16
17 my $rss_entry;
18 my $content = <<'EOC';
19 But that's XML::RSS's problem. Oh, and this would
20 be an XML::Feed::Content item as specced in the docs, but there is no
21 constructor documented for XML::Feed::Content and I know this works
22 anyway.
23 EOC
24
25 ok($rss_entry = XML::Feed::Entry->new('RSS'), "Got entry");
26 ok($rss_entry->title("Title is not always a required element in RSS2"), "Set entry title");
27 ok($rss_entry->content($content),                                       "Set entry content");
28 ok($rss_entry->link('http://nowhere.com/themiddle'),                    "Set entry link");
29
30 ok($rss_feed->add_entry($rss_entry),                                    "Added entry");
31
32 like($rss_feed->as_xml, qr/problem/i,                                   "Feed has body");
33