I've got a single method in my namespace that I'd like to mock, but I'd prefer that all the others work normally. Is it possible to have sinon mock a specific method while leaving the others the same?
My understanding is I'm not looking for a spy because I want to assert that the mock was called with specific parameters.
Here's my code in CoffeeScript:
root.targeting.handleUnitsAttack = (gameState) ->
units = gameState.heroes.concat(gameState.badGuys)
for source in units
for target in units
gameState = root.targeting.sourceAttackTarget(gameState, source, target)
gameState
I'd like to mock sourceAttackTarget
and verify that its arguments are specific values.