On 2015-05-12 12:40 PM, R. Ransbottom wrote:
On Mon, May 11, 2015 at 03:22:46PM -0700, Darren Duncan wrote:

you can use "trusts".  Also having to do this may indicate bad code
design. -- Darren Duncan

I saw Moritz' and Carl's responses and I agree with the smell
issue.

Given that the code exists and needs testing, 'augment' seems
preferable to 'trust'.  'augment' avoids the predeclaration
issue and simplifies the test code by removing indirection.

Is class finalization implemented?  Searching the synopses, I
found only a mention.

The other question is whether your "private" need to be private.

Generally speaking tests should only be against a public interface, and if you really need to test something private then maybe a refactoring of the thing being tested is in order.

For example splitting it into multiple classes where what was private becomes the public API of a utility consumed by the other class.

Any private routines you should be able to test sufficiently indirectly by way of public routines that use them, if the code is well organized.

-- Darren Duncan


Reply via email to