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

Provide an argument matcher function that takes an argument #136

Closed
nhaarman opened this issue Dec 8, 2016 · 0 comments
Closed

Provide an argument matcher function that takes an argument #136

nhaarman opened this issue Dec 8, 2016 · 0 comments
Labels
type:proposed-enhancement A proposed enhancement to the api or behavior
Milestone

Comments

@nhaarman
Copy link
Collaborator

nhaarman commented Dec 8, 2016

Currently there is argThat and argForWhich which take extension functions T.() -> Boolean.
These are useful in situations like:

verify(mock).call(argForWhich<List> { size == 3 })

However, in some cases using an argument is more natural. Proposal to add an argWhere function that takes a function (T) -> Boolean:

verify(mock).call(argThat<String> { this == "test" })
  // vs
verify(mock).call(argWhere<String> { it == "test" })

This is somewhat related to #134.

@nhaarman nhaarman added the type:proposed-enhancement A proposed enhancement to the api or behavior label Dec 8, 2016
@nhaarman nhaarman modified the milestones: 1.0.1, 1.1.0 Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:proposed-enhancement A proposed enhancement to the api or behavior
Projects
None yet
Development

No branches or pull requests

1 participant