[Koha-devel] Unit tests and mock module

Jared Camins-Esakov jcamins at cpbibliography.com
Fri Sep 7 14:47:32 CEST 2012


Paul,

I just pushed t/Members_AttributeTypes.t unit tests that fake the
> database. The test here could be redundant with t/db_dependent tests
>
> I feel we should be aware of that, and :
>  * decide Mock is the way to go, and promote using of Mock, removing
> db_dependent tests (that fail if you don't have a database)
>

This option is -- in my opinion -- much superior. However, a db_dependent
test is better than nothing.


>  * decide we should prefer db_dependent tests and limit the use of Mock
> to specific cases
>
> I feel that deciding nothing will result in a poor readability of what
> tests what, and some difficulties to know which test is to update when
> you update a sub.
> So, as Mock is introduced, we must speak of it.
>

I would rather duplicate tests than have untested code. I see no reason for
making an absolute decision.

Regards,
Jared

-- 
Jared Camins-Esakov
Bibliographer, C & P Bibliography Services, LLC
(phone) +1 (917) 727-3445
(e-mail) jcamins at cpbibliography.com
(web) http://www.cpbibliography.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20120907/31999a7f/attachment.htm>


More information about the Koha-devel mailing list