Skip to content
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

Feature: allow to combine @SpyK with @InjectMockKs #315

Closed
vadim-shb opened this issue Jun 12, 2019 · 5 comments
Closed

Feature: allow to combine @SpyK with @InjectMockKs #315

vadim-shb opened this issue Jun 12, 2019 · 5 comments

Comments

@vadim-shb
Copy link

As I can see, the following syntax doesn't work:

    @RelaxedMockK
    private lateinit var someDao: SomeDao

    @InjectMockKs
    @SpyK
    private lateinit var underTest: UnderTest

I think it would be great if it's become an equivalent of the next snippet:

    @RelaxedMockK
    private lateinit var someDao: SomeDao

    @InjectMockKs
    private lateinit var underTest: UnderTest

    @BeforeEach
    fun setup() {
        underTest = spyk(underTest)
    }

So we'll be able to spy/redefine some out of test methods in the tested class.

@stale
Copy link

stale bot commented Aug 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as stale just ask to put an important label.

@stale stale bot added the stale label Aug 11, 2019
@stale stale bot closed this as completed Aug 18, 2019
@U1F984
Copy link

U1F984 commented Oct 17, 2019

This would be very nice to have.

@oleksiyp oleksiyp reopened this Oct 19, 2019
@stale stale bot removed the stale label Oct 19, 2019
@oleksiyp oleksiyp changed the title @SpyK with @InjectMockKs usage Feature: combine @SpyK with @InjectMockKs Nov 2, 2019
@oleksiyp oleksiyp changed the title Feature: combine @SpyK with @InjectMockKs Feature: allow to combine @SpyK with @InjectMockKs Nov 2, 2019
@oleksiyp oleksiyp added this to To do in MockK features Nov 2, 2019
@oleksiyp oleksiyp added this to To do in Low hanging fruits Nov 2, 2019
@IlyaEremin
Copy link

Any updates?

1 similar comment
@feltrix
Copy link

feltrix commented Jul 31, 2020

Any updates?

@Raibaz
Copy link
Collaborator

Raibaz commented Nov 23, 2020

This was fixed by #529 and will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
MockK features
  
To do
Development

No branches or pull requests

6 participants