Mockingjay
Mockingjay copied to clipboard
Add example project
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.
+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. Am I doing something wrong?
@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.