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

[7.x] Refactor beVoid matcher using Predicate.simpleNilable #552

Merged
merged 1 commit into from Jul 4, 2018

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Jun 26, 2018

Replacing Predicate.fromDeprecatedClosure.

@ikesyo ikesyo requested a review from a team June 26, 2018 12:11
@ikesyo ikesyo changed the title [7.x] Refactor beVoid matcher using Predicate.define [7.x] Refactor beVoid matcher using Predicate.simpleNilable Jun 29, 2018
Copy link
Contributor

@sharplet sharplet left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -2,10 +2,9 @@ import Foundation

/// A Nimble matcher that succeeds when the actual value is Void.
public func beVoid() -> Predicate<()> {
return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in
failureMessage.postfixMessage = "be void"
return Predicate.simpleNilable("be void") { actualExpression in
Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely cleaner 👍

@ikesyo
Copy link
Member Author

ikesyo commented Jul 4, 2018

Appreciate your review! 😂

@ikesyo ikesyo merged commit b9e2712 into 7.x-branch Jul 4, 2018
@ikesyo ikesyo deleted the refactor-bevoid-matcher branch July 4, 2018 17:35
Megal pushed a commit to Megal/Nimble that referenced this pull request Jul 31, 2019
[7.x] Refactor `beVoid` matcher using `Predicate.simpleNilable`
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.

None yet

2 participants