-
-
Notifications
You must be signed in to change notification settings - Fork 24
add should.equals #95
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
Conversation
|
@bordecal does it make sense to assume that the right assertion would be |
|
If the subject is a collection |
|
@Meir017 Do you mean for a fixer? If so, for a primitive type, For complex types, it's more difficult to predict the right option. Maybe |
|
@jnyrup I'm pretty sure it's possible to detect the type of actual object used in the assertion. would that make sense? |
|
Have just run into this very issue in several of our code-bases today. If the object is a collection, For my needs, I think that For what it's worth, I think this analyzer is extremely important. |
|
@JamesDriscoll I have been really busy lately, I really want to get back to this project too :) |
|
Let me know if you need any help :) |
|
@JamesDriscoll @jnyrup Maybe we could have two code fixes suggested and each having a different message, one for primitives and the other for collection and custom classes? |
|
I think one message for collections going to A lot of tests we write create different but equivalent objects. I personally think it is much, much less likely to have tests where the actual versus expected would satisfy Perhaps the compromise would be to offer |
|
Some considerations:
So it comes down to whether the fixer has to be perfect. |
|
@jnyrup Great suggestions! |
|
Thanks for picking this up so swiftly - I think it will really adds a lot of value once it gets out into the wild :)
I know this is already merged, but the other alternative would be not to offer a fix in all cases, but still warn. |
That's probably the direction I would have taken. |
closes #94