Skip to content
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

Open
ogezue opened this issue Jan 7, 2016 · 7 comments
Open

Add example project #37

ogezue opened this issue Jan 7, 2016 · 7 comments
Labels

Comments

@ogezue
Copy link

ogezue commented Jan 7, 2016

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.

@nitinalabur
Copy link

+1

@paulyoung
Copy link

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

@paulyoung
Copy link

@arielelkin
Copy link

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

@kylef
Copy link
Owner

kylef commented May 16, 2016

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 kylef added the question label May 16, 2016
@papertigers
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants