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

Add beEmpty matcher for SetAlgebra #594

Merged
merged 2 commits into from
Aug 21, 2018
Merged

Add beEmpty matcher for SetAlgebra #594

merged 2 commits into from
Aug 21, 2018

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Aug 10, 2018

Partially implements #496.

@ikesyo ikesyo requested a review from a team August 10, 2018 16:33
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.

This looks good to me, just one suggestion 👍

@@ -34,16 +34,12 @@ final class BeEmptyTest: XCTestCase, XCTestCaseProvider {

expect("").to(beEmpty())
expect("foo").toNot(beEmpty())

expect([] as NSSortOptions).to(beEmpty())
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels slightly weird to rely on NSSortOptions here, how do you feel about creating a TestOptionSet type for testing purposes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense 👍

@@ -73,5 +69,35 @@ final class BeEmptyTest: XCTestCase, XCTestCaseProvider {
failsWithErrorMessage("expected to be empty, got <foo>") {
expect("foo").to(beEmpty())
}

failsWithErrorMessage("expected to not be empty, got <NSSortOptions(rawValue: 0)>") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Having our own option set type here would also decouple us from NSSortOptions's implementation of string conversion.

@ikesyo ikesyo force-pushed the setalgebra-beempty branch from dce0a49 to 9e2e6b4 Compare August 20, 2018 13:51
@ikesyo
Copy link
Member Author

ikesyo commented Aug 20, 2018

@sharplet Addressed your feedback!

@ikesyo ikesyo requested a review from sharplet August 20, 2018 13:52
@ikesyo ikesyo merged commit e4833d8 into master Aug 21, 2018
@ikesyo ikesyo deleted the setalgebra-beempty branch August 21, 2018 15:17
Megal pushed a commit to Megal/Nimble that referenced this pull request Jul 31, 2019
Add `beEmpty` matcher for `SetAlgebra`
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