spying for tests