hesco has asked for the wisdom of the Perl Monks concerning the following question:
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.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');
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strengthening a fragile test
by Corion (Patriarch) on Feb 12, 2011 at 09:10 UTC | |
|
Re: strengthening a fragile test
by Anonymous Monk on Feb 12, 2011 at 06:19 UTC | |
|
Re: strengthening a fragile test
by budman (Sexton) on Feb 13, 2011 at 08:24 UTC |