4 use Test::More tests => 14;
11 my $rss = XML::Feed->parse(
12 File::Spec->catfile(File::Spec->curdir(),
13 "t", "samples", "rss10-double2.xml"
18 isa_ok($rss, 'XML::Feed::Format::RSS');
19 my $rss_entry = ($rss->entries)[0];
22 isa_ok($rss_entry, 'XML::Feed::Entry::Format::RSS');
25 my $rss_content = $rss_entry->content;
28 isa_ok($rss_content, 'XML::Feed::Content');
31 is($rss_content->type, 'text/html', 'Correct content type');
34 like($rss_content->body, qr(<|<), 'Contains HTML tags');
37 like($rss_content->body,
38 qr{\Q<img src="http://s.ph-cdn.com/newman/gfx/news/2011/3-neuroscienti.jpg" width="300" class="articleImage" />},
39 'Contains HTML tags');
41 unlike($rss->as_xml, qr{&lt;}, 'No double encoding');
43 my $atom = $rss->convert('Atom');
46 isa_ok($atom, 'XML::Feed::Format::Atom');
48 my $atom_entry = ($atom->entries)[0];
51 isa_ok($atom_entry, 'XML::Feed::Entry::Format::Atom');
53 my $atom_content = $atom_entry->content;
56 isa_ok($atom_content, 'XML::Feed::Content');
59 is($atom_content->type, 'text/html', 'Correct content type');
62 like($atom_content->body, qr(<|<), 'Contains HTML tags');
65 like($atom_content->body,
66 qr{\Q<img src="http://s.ph-cdn.com/newman/gfx/news/2011/3-neuroscienti.jpg" width="300" class="articleImage" />},
67 'Contains HTML tags');
69 unlike($atom->as_xml, qr{&lt;}, 'No double encoding');