Utilities for spying on function calls in unit tests
