nysus has asked for the wisdom of the Perl Monks concerning the following question:
I'm new to testing. I've got a test that uses a call to a private method like so:
# Check that module loads data my $xyz_events = $checker->_get_event_data('arg'); my $is_hash_ref = ref $xyz_events eq 'HASH'; is $is_hash_ref, 1, 'returns a hash ref';
I'm thinking it's OK to break the rules a bit since I'm just running tests. It also seems like it makes writing tests easier by testing small components of the module. But I worry it's a sign that I'm going about testing in the wrong way. What is the opinion of the wiser Monks about this?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing private methods a no-no?
by davido (Cardinal) on May 20, 2016 at 14:46 UTC | |
|
Re: Testing private methods a no-no?
by haukex (Archbishop) on May 20, 2016 at 14:32 UTC | |
|
Re: Testing private methods a no-no?
by shawnhcorey (Friar) on May 20, 2016 at 20:40 UTC | |
by Athanasius (Archbishop) on May 22, 2016 at 05:50 UTC | |
by Anonymous Monk on May 20, 2016 at 21:01 UTC |