-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Missing Feature? Mocking dynamic type #31
Comments
This is to be added. I was thinking about use cases before and it seems for me pretty weird. For plugins/extensions and less "user-facing" things there is direct Gateway API that can be used. |
@oleksiyp Thanks. |
Gateway API should be okay if you do it once. Check #23 |
I think I can easily add something alike |
@a1flecke please check http://mockk.io/#class-mock and close ticket if it fulfills your request. Vesrion 1.7.8 |
Sounds good. The other piece that I ended up needing was resetting the
mocks call count. I ended up grabbing a reference to the callrecorder and
calling reset. I suspect this “resets the world “ and not just the
individual mocks. A little heavy handed, but it works for now.
I can file a separate issue about that if you prefer.
Aaron
…On Thu, Feb 22, 2018 at 1:41 AM Oleksiy Pylypenko ***@***.***> wrote:
I think I can easily add something alike classMockk, as your case is not
extension or plugin. #23 <#23> was
exactly about JUnit extension
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#31 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACrU-1DAw15IHz85uF7wICpm1Ic45_1Dks5tXRoTgaJpZM4SNzxO>
.
|
Hm, looks something is going wrong, but I don't understand why you require calling "reset". It is not "reset the world" actually. This reset is rather local for "every" and "verify" constructs. It is resetting state machine that controls recording state(i.e. one when calls are recorded for verification/stubbing) vs normal state(when it is just called). It is in public API because useful to be called for example before tests via some testing framework extensions to isolate tests. Have you checked |
I must have missed this. Switched to using this. Thanks. |
Seems main issue was fixed |
Use Case: In mockito I was doing this:
I cannot figure out a way in mockk to do the equivalent of
mock(requestClass)
where the class is not known at compile time. I fully admit that I am missing something here.The text was updated successfully, but these errors were encountered: