-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Bug: Mocking varargs #52
Comments
Look like issue is appearing when using
I've checked underlying reflection call and seems Kotlin is just not returning correct value. So it is a Kotlin reflection API bug |
After additional checking, it appears that pure interface is working. So it is related to metadata propagation i.e. while using interface MockK needs to create a proxy subclass and Kotlin metadata is not copied to that subclass. |
So yes this because of subclassing. |
@oleksiyp I cannot verify vararg, method with vararg always fail verification (except |
Very probable that this is related. Right now(one/two weeks) I'm quite free for doing MockK improvements/fixes but focused on Android instrumentation test which is a big feature. Will get back to such not very big things after releasing it. I desperately need good co-author :-) |
In version 1.8 it should be fixed. Please check |
Seems it was fixed, reopen if it is not |
What's the fix for this @oleksiyp ? I'm using 1.9 and having trouble mocking a varargs. |
Please report as a new bug |
In Mockito there is
anyVararg()
but mockk does not have this.Consider the following example:
Is there another way to mock the vararg version of
foo
?The text was updated successfully, but these errors were encountered: