-
Notifications
You must be signed in to change notification settings - Fork 178
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 example project #37
Comments
+1 |
Mockingjay is used in Disc and Portal, both of which use MockingjayMatchers. |
More specifically, here's where a request is stubbed out and here's the custom matcher used. |
@paulyoung thanks for sharing, but this is insufficient, it's still not clear how to setup a basic test suite from scratch using Mockingjay and XCTest. |
There's a complete example in Mockingjay's own tests. Check out https://github.com/kylef/Mockingjay/blob/master/MockingjayTests/MockingjayTests.swift#L34-54 |
I tried to use the following with Alamofire from the example you linked @kylef let stubbedError = NSError(domain: "Mockingjay Session Tests", code: 0, userInfo: nil)
stub(everything, builder: failure(stubbedError)) When I call the function from my api struct it returns the actual data from the web service. |
@kylef never mind, console output was misleading due to the test target having "Host Application" set. This seems to be xcodes preferred way now. Sorry for the confusion. |
Is it possible to add an example project to see how to setup a complete project? At the moment it is not very clear how to use Mockingjay which will prevent many developers from using it.
The text was updated successfully, but these errors were encountered: