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

Update Mockint.kt to include implementation of itReturnsConsecutively #143

Closed
wants to merge 3 commits into from

Conversation

Nescafemix
Copy link

@Nescafemix Nescafemix commented Jun 20, 2019

Description
the itReturns method doesn't let to return multiple values (something that Mockito resolve with an implementation of thenReturn(firstvalue, array_of_next_values))

Expected result:
we can return several values in case we need it

example:
When calling mockView.isReady itReturnsConsecutively listOf(true, false)

Checklist

  • I've added my name to the AUTHORS file, if it wasn't already present.

In case we need to return multiple values from a mock, we need to implement the call to thenReturn(firstvalue, array_of_next_values)
@MarkusAmshove
Copy link
Owner

Hi @Nescafemix . thank you for your contribution :-)

Could you add a test to showcase how to use this? When there are questions about a certain assertion/feature, I'd like to guide people to the test.
Otherwise looking good!

@MarkusAmshove MarkusAmshove mentioned this pull request Jul 8, 2019
18 tasks
@Nescafemix
Copy link
Author

Hi @Nescafemix . thank you for your contribution :-)

Could you add a test to showcase how to use this? When there are questions about a certain assertion/feature, I'd like to guide people to the test.
Otherwise looking good!

Sure :). Let me check it tomorrow and do it :)

@jcornaz
Copy link
Contributor

jcornaz commented Jul 18, 2019

Hi all,

Weren't mocking features about to be removed in Kluent 2.0?

(see #73, #75 and #75 (comment))

@MarkusAmshove
Copy link
Owner

I'm currently evaluating the move to 2.0 and consider adding an additional artifact to move all the mocking related stuff into.
So this PR would still be valid in this form for 1.x and when moving to 2.x I would love all the stuff to, e.g. kluent-mockito. That way they can coexist and current code doesn't break, just needing to depend on a different artifact

@MarkusAmshove
Copy link
Owner

Mocking will be removed in the future (once Kotlin Multiplatform is considered stable), so I'll close this PR.
Sorry for the time you've already spend on this.
I'll revisit PRs and Mocking once upgraded and think about a module system that allows Kluent to ship an artifact for mockito.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants