-
Notifications
You must be signed in to change notification settings - Fork 174
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
Segmentation fault 11 with closure and Alamofire? #124
Comments
Hi, please show us the signature of |
Hi @TadeasKriz and thx for your answer. |
@arnlen Please come to our Slack channel: http://swiftkit.brightify.org/ to discuss this, I'll try to guide you so we can find what's causing this. |
Problem solved thanks to @TadeasKriz. 🎉 For future reference, the problem is that Cuckoo doesn’t know the Solution: add a func equal(to value: URLRequestConvertible) -> ParameterMatcher<URLRequestConvertible> {
return ParameterMatcher { tested in
(try? tested.asURLRequest()) == (try? value.asURLRequest())
}
} Final version of the test method: func testSigninWith() {
let parameters: Parameters = [
"email": "user@example.com",
"password": "foobar"
]
let mock = MockApiTools()
stub(mock) { stub in
_ = stub.callApi(with: equal(to: SessionRouter.signin(parameters)), from: any(), responseStatusCode: 201, anyClosure())
}
// [...] Test implmentation
} |
Source to test:
Test code:
Boom error:
It appear to be linked to the use closure.
The text was updated successfully, but these errors were encountered: