16 Feb 2015 by dryobates
My coworker asked me to explain him how to use mock library while writing tests. Why to tell him how to use it? Let he gave it a try at Coding Dojo!.
So we get our hand into two of Racing Cars kata. That kata are simple enough so that we don’t need to dig hard into code to find out what it is doing. But there is at least two objects in game so there’s some space for using mocks.
That kata can be done easily without mock library  but the purpose of this coding dojo was to learn how to use that library. Because of that I a little broke coding dojo rules (with acceptance of participants) and forced my coworkers to use different methods of patching. That was only to show them that in different cases we can use different approaches.
How did my coworkers cope with mocking? I think they won’t have problem with mocking in their professional job. I hope they won’t overuse it either.