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

Fake UIApplication #5

Open
orta opened this issue Aug 4, 2015 · 0 comments
Open

Fake UIApplication #5

orta opened this issue Aug 4, 2015 · 0 comments

Comments

@orta
Copy link
Collaborator

orta commented Aug 4, 2015

https://github.com/orta/energy/blob/314b0d741e8f9b5754284f4ed52f24fb7cfb89bd/ArtsyFolio%20Tests/View%20Controllers/ARLoginViewControllerTests.m#L4-L13

/// Without this, the tests are dependant on if Eigen is installed
@interface FakeApplication : NSObject
@end


@implementation FakeApplication
- (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation {}
- (BOOL)openURL:(NSURL *)url { return NO; }
- (BOOL)canOpenURL:(NSURL *)url { return NO; }
@end

This one is really simple, but a better version can be built. This is used ATM for checking if app x exists, but can be built do do more.

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

No branches or pull requests

1 participant