For some reason these functions are setup to disable the over writing of previous registrations.
For instance, register should 'Stores an action against a signature that will always fire unless masked by a time specific one.'
It will only in fact do so for the first time of calling - if you call it again, and attempt to override a previous setting, then this is appended within the internal SimpleSignatureMap object, leading to it being inaccessible and never (as far as I can see) used.
The same is true of registerAt - 'Stores an action against a signature that will fire at a specific time in the future.' - except it doesn't if you re-register, essentially calling returnValueAt(1,<value>) more than once - the second call will be ignored, having been appended the SimpleSignatureMap object rather than replacing it.
There may be a perfectly rational explanation for this behaviour internally, but the public interface that testers call into (returnValue, returnValueAt) do not behave as one would expected when called twice.
Log in to post a comment.