-
Notifications
You must be signed in to change notification settings - Fork 466
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
Type coercion does not work during interaction verification #1260
Comments
Can you try with 2.0? |
The issue still remains in the newest version that I can find in https://mvnrepository.com - 2.0-M3-groovy-2.5.
|
Not yet fixed in 2.0-M4-groovy-3.0:
|
Thanks for checking. Btw, not related with your question, but get know that some time ago I improved the mock creation syntax and currently you can just write:
instead of:
and still doesn't have a warning in Idea. |
Thanks, will try to use it with 1.3, the version in my project! I use Eclipse, by the way. |
Just interested, since which version did you improve mock creation syntax? I don't see warnings in Eclipse with 1.2, 1.3, 2.0. |
This is a corner case of the argument matcher API. Normally you'd write something like this: Spock transforms The transform logic is here However, changing this is not a super high priority as there are alternative ways to assert the same, which you already found. 1 * good.accept({it == [] as Set})
1 * good.accept({it.empty} as Set) |
I've check it, and surprisingly, the commit was made over 5 years ago. Spock 1.1+. |
I've created a potential fix for this special case, but there will still be many other cases where this won't apply. WDYT @spockframework/supporter ? |
Is this not a general issue with generic types? Generally I think adding the special case is a good idea as collections are an extremely common use case. |
results in failure
Spock version: 1.3-groovy-2.5.
The text was updated successfully, but these errors were encountered: