Sorry - I didn’t make myself very clear. I was expecting that code to work, but it fails. I just used ‘this’ in the example to make it easy to “copy/paste and run”.
Originally I was hoping to use argument type matching - like MightyMock does:
Then I tried using a mock for the second argument, but got undefined errors. I hope that makes a bit more sense?
Revisiting this now. As of now, MockBox does not support type matching, do you think this is a necessary addition when the arguments could potentially be anything in ColdFusion?
Yeah I think this will be a tough one to implement, my question would be this. As ColdFusion is cough typeless, then this would make this rather hard. especially how would you handle how ColdFusion can send extra arguments to the method / function as well (Which I personally don’t like about ColdFusion).
I am not sure what it was you are actually testing there, with which I am guessing that the second argument is optional, which would make it even hard to.
Could you describe what it is you are actually trying to test for?