-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathARTiledImageViewControllerTests.m
68 lines (58 loc) · 2.31 KB
/
ARTiledImageViewControllerTests.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// ARTiledImageViewTests.m
// ARTiledImageView
//
// Created by Daniel Doubrovkine on 3/15/14.
// Copyright (c) 2014 Artsy. All rights reserved.
//
#import "ARTiledImageDemoViewController.h"
SpecBegin(ARTiledImageDemoViewController)
__block ARTiledImageDemoViewController *vc = nil;
describe(@"remote", ^{
beforeEach(^{
UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
vc = [[ARTiledImageDemoViewController alloc] init];
// https://artsy.net/artwork/francisco-jose-de-goya-y-lucientes-senora-sabasa-garcia
// (Courtesy National Gallery of Art, Washington)
vc.tilesURL = [NSURL URLWithString:@"https://raw.github.com/dblock/ARTiledImageView/master/Tiles/SenoraSabasaGarcia"];
vc.tiledSize = CGSizeMake(2383, 2933);
vc.minTileLevel = 11;
vc.maxTileLevel = 12;
window.rootViewController = vc;
expect(vc.view).willNot.beNil();
[window makeKeyAndVisible];
});
it(@"displays map", ^{
waitUntil(^(DoneCallback done) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long) NULL), ^(void) {
[NSThread sleepForTimeInterval:3.0];
expect(vc.view).to.haveValidSnapshotNamed(@"remote");
// expect(vc.scrollView.tileZoomLevel).to.equal(11);
done();
});
});
});
});
describe(@"local", ^{
beforeEach(^{
UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
vc = [[ARTiledImageDemoViewController alloc] init];
vc.tilesPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Tiles/Armory2014"];
vc.tiledSize = CGSizeMake(5000, 5389);
vc.minTileLevel = 11;
vc.maxTileLevel = 13;
window.rootViewController = vc;
expect(vc.view).willNot.beNil();
[window makeKeyAndVisible];
});
it(@"displays map", ^{
waitUntil(^(DoneCallback done) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long) NULL), ^(void) {
[NSThread sleepForTimeInterval:2.0];
expect(vc.view).to.haveValidSnapshotNamed(@"local");
done();
});
});
});
});
SpecEnd