Hi! Thanks a lot for your reply!
As for the testing part, I had checked those modules indeed, but had the following thoughts about them:
- their use seem to be very sequential, where I would prefer an object approach
- I will need some "common" mocked services to use with all my different tests, and I don't want to duplicate mocking codes for each test, even though I could factorize the mocking in some shared methods
In the end, I can see this advantage of using
Test::MockObject over using mocking by inheritance as I was suggesting:
- gain ability to check the program's behaviour vis-a-vis the mocked class (via methods like call_pos, call_args, next_call, etc.)
What other advantages would I gain?
Is there any caveats at mocking by inheritance as I was suggesting?
PS: oh, about your comment, I may have misused the word 'environnement' in my question: I didn't mean architecture environment but rather meant 'test situation' (I corrected it in the text).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.