-
Notifications
You must be signed in to change notification settings - Fork 255
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
Identifying substitutes #44
Comments
I need it too. I want to mark my substitutes in the Output window because now I have this:
I want this:
|
@dtchepak What if we simply override |
@zvirja I think it would be useful to add a custom description. And I think we should avoid overriding |
#379 partially addresses this by giving substitutes identifiers based on hashCode, but I would still like the feature of being able to "name" a specific instance of a substitute as per CompleteBrains' comment. See Zvirja's notes on this PR for some suggestions on implementing this with |
@dtchepak I'm not sure we need this feature 😕 Sure, it's interesting from the technical perspective, but I don't see much value in it. The already merged PR allows you to clearly indentify the substitute. The id consists of type name and hash code. It's unlikely that often we will be able to find the better name than The main concern from @CompleteBrains what that it was impossible to recognize the substitute and it was addressed. I'd suggest to close the issue as is and reopen it later only if there are explicit requests for it. It will allow us to see how it goes with the current way and whether we really need it. WDYT? 😉 |
@zvirja I think there are still some legitimate use cases not covered by the current id scheme. For mocking in acceptance tests like https://gist.github.com/GraemeF/b759fa100814bd04eb11 I don't think a random identifier will assist in finding the source of the substitute. Instead if we could tag a substitute on creation (something like
I'm happy to wait on another request and a real example (I had lots a long time ago on a previous project, but nothing current) before progressing with this though. :) |
This would make tests far more readable, +1 from me. |
Scenario here:
https://gist.github.com/b759fa100814bd04eb11
Could create with a Name or allow overriding ToString(). Perhaps provide default id# for substitutes.
The text was updated successfully, but these errors were encountered: