Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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(); }

In reply to strengthening a fragile test by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-14 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found