Mockingjay icon indicating copy to clipboard operation
Mockingjay copied to clipboard

Add example project

Open ogezue opened this issue 9 years ago • 7 comments

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.

ogezue avatar Jan 07 '16 10:01 ogezue

+1

nitinalabur avatar Jan 11 '16 16:01 nitinalabur

Mockingjay is used in Disc and Portal, both of which use MockingjayMatchers.

paulyoung avatar Jan 14 '16 00:01 paulyoung

@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.

arielelkin avatar Mar 21 '16 11:03 arielelkin

There's a complete example in Mockingjay's own tests. Check out https://github.com/kylef/Mockingjay/blob/master/MockingjayTests/MockingjayTests.swift#L34-54

kylef avatar May 16 '16 04:05 kylef

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?

papertigers avatar Jul 14 '16 06:07 papertigers

@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.

papertigers avatar Jul 16 '16 05:07 papertigers