$spy()
Spy like us!
void function doSomething(foo){
// some code here then...
local.foo = variables.collaborator.callMe(local.foo);
variables.collaborator.whatever(local.foo);
}function test_it(){
local.mocked = createMock( "com.foo. collaborator" )
.$spy( "callMe" )
.$spy( "whatever" );
variables.CUT.$property( "collaborator", "variables", local.mocked );
assertEquals( 1, local.mocked.$count( "callMe" ) );
assertEquals( 1, local.mocked.$count( "whatever" ) );
}Was this helpful?