Spy

A spy differs from mock objects in term of behavior corroboration. A spy acts more like a logger and instead of setting up behavioral expectations, it will log the calls made to the co-worker. A unit test will later assert the logs from the spy.

Get Scala Test-Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.