[Bast-commits] r9571 - ironman/branches/mk-ii/Perlanet-IronMan/t

idn at dev.catalyst.perl.org idn at dev.catalyst.perl.org
Thu Jun 3 10:16:40 GMT 2010


Author: idn
Date: 2010-06-03 11:16:40 +0100 (Thu, 03 Jun 2010)
New Revision: 9571

Added:
   ironman/branches/mk-ii/Perlanet-IronMan/t/02_xml_feed.t
   ironman/branches/mk-ii/Perlanet-IronMan/t/03_uri_fetch.t
Log:
Adding some investigatory tests.

Added: ironman/branches/mk-ii/Perlanet-IronMan/t/02_xml_feed.t
===================================================================
--- ironman/branches/mk-ii/Perlanet-IronMan/t/02_xml_feed.t	                        (rev 0)
+++ ironman/branches/mk-ii/Perlanet-IronMan/t/02_xml_feed.t	2010-06-03 10:16:40 UTC (rev 9571)
@@ -0,0 +1,20 @@
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use XML::Feed;
+my $feed = XML::Feed->parse(URI->new('http://yapgh.blogspot.com/feeds/posts/default')) or die XML::Feed->errstr;
+
+print $feed->title, "\n";
+
+
+
+for my $entry ($feed->entries) {
+
+my @tags = $entry->category;
+print("Tags : " . join(",", @tags) . "\n");
+
+}
+
+

Added: ironman/branches/mk-ii/Perlanet-IronMan/t/03_uri_fetch.t
===================================================================
--- ironman/branches/mk-ii/Perlanet-IronMan/t/03_uri_fetch.t	                        (rev 0)
+++ ironman/branches/mk-ii/Perlanet-IronMan/t/03_uri_fetch.t	2010-06-03 10:16:40 UTC (rev 9571)
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use URI::Fetch;
+use XML::Feed;
+
+#my $feed = XML::Feed->parse(URI->new('http://yapgh.blogspot.com/feeds/posts/default')) or die XML::Feed->errstr;
+my $response = URI::Fetch->fetch('http://yapgh.blogspot.com/feeds/posts/default',
+                                 #UserAgent     => $self->ua,
+                                 #Cache         => $self->cache || undef,
+                                 ForceResponse => 1,
+);
+
+my $data = $response->content;
+
+
+my $feed = XML::Feed->parse(\$data);
+
+print $feed->title, "\n";
+
+
+
+for my $entry ($feed->entries) {
+
+my @tags = $entry->category;
+print("Tags : " . join(",", @tags) . "\n");
+
+}
+
+




More information about the Bast-commits mailing list