-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
td.replace multiple property names at once #146
Comments
At first blush, you're right that the call would be nice:
That looks good. My issue is what the return value should be. At present,
So my issue with this proposal is that getting an But, if we were to actually do that, then the difference between If I ask myself "what behavior do I want to encourage with terse syntax", it's definitely that I want people to pass totally fake objects to their subjects so they have clear control over everything that object is doing and there is no ambiguity to the read as to what's real and what's fake. What this feature would do is encourage people to pick-and-choose methods (perhaps only the ones they think the subject needs) and effectively be encouraged by td's API to create Partial Mocks. Partial mocks are really an antipattern and I wouldn't want to aid & abet their creation. To be honest, now that I have had a chance to reflect on this, the only reason I included the So, in summary, I'm okay with the awkwardness of multiple |
I'm wondering if it would be possible to replace multiple property names on a object.
Right now we have to:
It would be nicer:
Return an array of stubbed functions instead of a single one.
The text was updated successfully, but these errors were encountered: