What did you do?
I attempted to use Custom Validation.
What did you expect to happen?
I expected the code sample provided in Custom Validation to provide working code.
What actually happened instead?
This code as written does not compile:
expect {
guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else {
return .failed(reason: "wrong enum case")
}
return .succeeded
}.to(succeed())
The return statements produce the errors:
Type '(() -> ToSucceedResult)?' has no member 'succeeded'
Type '(() -> ToSucceedResult)?' has no member 'failed'
Instead, each case needed to be wrapped in a closure:
expect {
guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else {
return { .failed(reason: "wrong enum case") }
}
return { .succeeded }
}.to(succeed())
Environment
List the software versions you're using:
- Quick: 4.0.0
- Nimble: 9.1.0
- Xcode Version: 13.2.1 (13C100)
- Swift Version: Xcode Default
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
Sample project:
What did you do?
I attempted to use Custom Validation.
What did you expect to happen?
I expected the code sample provided in Custom Validation to provide working code.
What actually happened instead?
This code as written does not compile:
The
returnstatements produce the errors:Instead, each case needed to be wrapped in a closure:
Environment
List the software versions you're using:
Please also mention which package manager you used and its version. Delete the
other package managers in this list:
http_archivetoolSample project: