Skip to content

Commit

Permalink
Module use, and cache updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed May 10, 2010
1 parent 96108ff commit 95fe1e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions lib/WebGUI/Asset/Wobject/SyndicatedContent.pm
Expand Up @@ -15,6 +15,7 @@ use HTML::Entities;
use WebGUI::Exception;
use WebGUI::HTML;
use WebGUI::International;
use LWP::UserAgent;

use Moose;
use WebGUI::Definition::Asset;
Expand Down
11 changes: 4 additions & 7 deletions t/Asset/Wobject/SyndicatedContent.t
Expand Up @@ -24,7 +24,6 @@ use Test::More tests => 22; # increment this value for each test you create
use Test::Deep;
use WebGUI::Asset::Wobject::SyndicatedContent;
use XML::FeedPP;
use WebGUI::Cache;

my $session = WebGUI::Test->session;
my %var;
Expand Down Expand Up @@ -153,12 +152,11 @@ $syndicated_content->update({
hasTerms => 'WebGUI',
});

my $cache = WebGUI::Cache->new($session, $tbbUrl, 'RSS');
open my $rssFile, '<', WebGUI::Test->getTestCollateralPath('tbb.rss')
or die "Unable to get RSS file";
my $rssContent = do { local $/; <$rssFile>; };
close $rssFile;
$cache->set($rssContent, 60);
$session->cache->set($tbbUrl.'RSS', $rssContent, 60);

my $filteredFeed = $syndicated_content->generateFeed();

Expand All @@ -172,7 +170,7 @@ cmp_deeply(
'generateFeed: filters items based on the terms being in title, or description'
);

$cache->delete;
$session->cache->clear;

####################################################################
#
Expand All @@ -189,18 +187,17 @@ $syndicated_content->update({
maxHeadlines => 50,
});

my $cache = WebGUI::Cache->new($session, $oncpUrl, 'RSS');
open my $rssFile, '<', WebGUI::Test->getTestCollateralPath('oncp.xml')
or die "Unable to get RSS file: oncp.xml";
my $rssContent = do { local $/; <$rssFile>; };
close $rssFile;
$cache->set($rssContent, 60);
$session->cache->set($oncpUrl.'RSS', $rssContent, 60);

my $oddFeed1 = $syndicated_content->generateFeed();

my @oddItems = $oddFeed1->get_item();
is (@oddItems, 13, 'feed has items even without pubDates or links');

$cache->delete;
$session->cache->clear;


0 comments on commit 95fe1e6

Please sign in to comment.