http://qs1969.pair.com?node_id=887724

hesco has asked for the wisdom of the Perl Monks concerning the following question:

I published another module the other day (WWW-Scrape-Mailman-RSS-0.12) and am now responding to the feedback I'm getting from the smoke testers. Fixing the first round of issues (attempts to create a file at a path which existed only in my local environment) was easy. But I can see that the code below is about to blow up in my face.

my %args = ( 'info_url' => 'http://ga.greens.org/mailman/listinfo/gpga-news', 'base_url' => 'http://ga.greens.org/pipermail/gpga-news', 'list_name' => 'gpga-news', 'audience' => 'Greens', 'description' => 'News by, about and for Greens', 'cycles' => 2, 'output_file' => 't/tmp/gpga_news_feed.html', 'rss_output' => 't/tmp/gpga_news_feed.rss', 'template' => 't/tmpl/gpga_news_feed.tmpl', ); my $news_feed = $feed->render_feed(\%args); # this is fragile and will break in two weeks my $latest_month = '2011-February'; my $next_latest_month = '2011-January'; like($news_feed,qr/$latest_month/,'Feed includes latest month'); like($news_feed,qr/$next_latest_month/,'it also includes the second mo +st recent month');
In fact, even if I could generate the $latest_month and $next_latest_month programmatically, this test would still fail from midnight the morning of the 1st of each month until the first post was archived to the test list each month.

Can someone please advise how I might make this test less fragile, please? Mocking it seems not quite right, because part of what I need to test is my ability to give this object an $args{'base_url'} and get back an rss feed.

Thanks,
-- Hugh

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }