-
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
replacing a nested dependency does not get reset correctly #293
Comments
Ok, I can get this to work with the following test... Which is not as per the examples, and makes me wonder about the td.replace state. But at least the td.reset does seem to clear things out (the call count is as expected).
|
I suspect the cause for this is that quibble doesn't know it shouldn't be caching the (Reason being: the test should be describing the contract between the Car and the Brake and not mucking with the internal implementation of the Brake's dependencies as it shouldn't have reason to know about them and be coupled to them.) As a result I'd consider this case to be unsupported/undefined behavior but I wouldn't be opposed to it working, either. The right place to look into implementing this is the quibble module: https://github.com/testdouble/quibble |
I am trying to replace a 'leaf' dependency, which seems to work fine the first time, but then fails the second time. It would appear that some global state is left behind, and whilst td.reset does reset some state, it looks like the td.when state is not cleared?
Repro case:
Which results in:
It would look like the BreakDisc is still replaced in the second test, but the td.when is no longer adhered to?
The text was updated successfully, but these errors were encountered: