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

Allows instanceOf and typeOf matchers to use the casted value #695

Merged
merged 2 commits into from
Feb 25, 2019

Conversation

LeoColman
Copy link
Member

This commit also adds some documentation to all related methods.

Fix #666

This commit also adds some documentation to all related methods.

Fix #666
@LeoColman LeoColman requested a review from sksamuel February 25, 2019 16:13
@LeoColman
Copy link
Member Author

@dave08

"Allow execution with a lambda" {
val list = arrayListOf(1, 2, 3)

list.shouldBeInstanceOf<ArrayList<Int>> { it: ArrayList<Int> ->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type was made explicit to enforce that this type won't change in the future, even though it's redundant for users

@sksamuel
Copy link
Member

This allows us to do t.shouldBeInstanceOf<T> { t -> ... } ?

@LeoColman
Copy link
Member Author

Yes. An example of this is on the test. I made the type explicit to ensure it won't change in the future

Copy link
Member

@sksamuel sksamuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work as always.

@LeoColman LeoColman merged commit ecc4d0a into master Feb 25, 2019
@LeoColman LeoColman deleted the feature/666-instanceof-matcher-with-lambda branch February 25, 2019 18:04
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.

2 participants