Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit 0043d58

Browse files
author
Ignacio Romero Zurbuchen
authored
Adds Snapshot tests + CI (#332)
* Re-organizes and simplified project structure Integrates Application sample project into same workspace as a new target Adds snapshot testing infra + snapshots all Application cases * Renames snapshot references directory * Tweaks the sample project to update the status bar style appropriately * Integrates Colors sample project into same workspace as a new target * Deletes old examples. Don't need them anymore. * Adds travis and codecov yml files, for setting up the CI * Adds Dangerfile * Wrong path! * Ignores the entire project directory, so only the lib source is checked-in for codecov * Adds codecov and travis badges in README * Codecov path correction
1 parent e612d4a commit 0043d58

1,231 files changed

Lines changed: 4389 additions & 17221 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
codecov:
2+
token:
3+
4+
coverage:
5+
precision: 2
6+
round: nearest
7+
range: 70...100
8+
ignore:
9+
- ./DZNEmptyDataSet/.*
10+
11+
status:
12+
project: true
13+
patch: true
14+
changes: false
15+
16+
comment:
17+
layout: "header, diff, tree, changes"
18+
behavior: default
19+
branches: master

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
osx_image: xcode8.1
2+
language: objective-c
3+
sudo: required
4+
5+
cache:
6+
- bundler
7+
- cocoapods
8+
9+
before_install:
10+
- bundle install
11+
- bundle exec danger
12+
13+
env:
14+
global:
15+
- LANG=en_US.UTF-8
16+
17+
- WORKSPACE="DZNEmptyDataSet/DZNEmptyDataSet.xcworkspace"
18+
- IOS_SCHEME="DZNEmptyDataSet"
19+
- IOS_SDK="iphonesimulator10.0"
20+
21+
matrix:
22+
- DESTINATION="OS=10.1,name=iPhone 7" SDK="$IOS_SDK" SCHEME="$IOS_SCHEME"
23+
24+
script:
25+
- xcodebuild clean build test -scheme "$SCHEME" -workspace "$WORKSPACE" SDK="$IOS_SDK" -destination "$DESTINATION" -configuration Debug GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
26+
27+
after_success:
28+
- bash <(curl -s https://codecov.io/bash)
File renamed without changes.

Examples/Applications/Applications/AppDelegate.m renamed to DZNEmptyDataSet/Applications/AppDelegate.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ @implementation AppDelegate
1313

1414
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
1515
{
16-
self.window.backgroundColor = [UIColor whiteColor];
16+
self.window.backgroundColor = [UIColor whiteColor];
17+
1718
return YES;
1819
}
1920

Examples/Applications/Applications/Application.h renamed to DZNEmptyDataSet/Applications/Application.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,7 @@ typedef NS_ENUM(NSUInteger, ApplicationType) {
5252

5353
- (instancetype)initWithDictionary:(NSDictionary *)dict;
5454

55+
+ (NSArray *)applicationsFromJSONAtPath:(NSString *)path;
56+
+ (NSArray *)applicationsFromJSON:(id)JSON;
57+
5558
@end

Examples/Applications/Applications/Application.m renamed to DZNEmptyDataSet/Applications/Application.m

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,35 @@ @implementation Application
1212

1313
- (instancetype)initWithDictionary:(NSDictionary *)dict
1414
{
15-
if (!dict) {
16-
return nil;
17-
}
18-
1915
self = [super init];
2016
if (self) {
21-
self.displayName = [dict objectForKey:@"display_name"];
22-
self.developerName = [dict objectForKey:@"developer_name"];
23-
self.identifier = [dict objectForKey:@"identifier"];
17+
self.displayName = dict[@"display_name"];
18+
self.developerName = dict[@"developer_name"];
19+
self.identifier = dict[@"identifier"];
2420
}
2521
return self;
2622
}
2723

24+
+ (NSArray *)applicationsFromJSONAtPath:(NSString *)path
25+
{
26+
NSData *data = [NSData dataWithContentsOfFile:path];
27+
NSArray *JSON = [[NSJSONSerialization JSONObjectWithData:data options:kNilOptions|NSJSONWritingPrettyPrinted error:nil] mutableCopy];
28+
29+
return [self applicationsFromJSON:JSON];
30+
}
31+
32+
+ (NSArray *)applicationsFromJSON:(id)JSON
33+
{
34+
NSMutableArray *objects = [NSMutableArray new];
35+
36+
for (NSDictionary *dictionary in JSON) {
37+
Application *obj = [[Application alloc] initWithDictionary:dictionary];
38+
[objects addObject:obj];
39+
}
40+
41+
return objects;
42+
}
43+
2844
- (void)setDisplayName:(NSString *)displayName
2945
{
3046
_displayName = displayName;

Examples/Countries/Countries/System.xcassets/AppIcon.appiconset/Contents.json renamed to DZNEmptyDataSet/Applications/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
22
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"size" : "29x29",
15+
"idiom" : "iphone",
16+
"filename" : "icon-29.png",
17+
"scale" : "1x"
18+
},
319
{
420
"size" : "29x29",
521
"idiom" : "iphone",
@@ -24,6 +40,18 @@
2440
"filename" : "icon-40@3x.png",
2541
"scale" : "3x"
2642
},
43+
{
44+
"size" : "57x57",
45+
"idiom" : "iphone",
46+
"filename" : "icon-57.png",
47+
"scale" : "1x"
48+
},
49+
{
50+
"size" : "57x57",
51+
"idiom" : "iphone",
52+
"filename" : "icon-57@2x.png",
53+
"scale" : "2x"
54+
},
2755
{
2856
"size" : "60x60",
2957
"idiom" : "iphone",
@@ -36,6 +64,16 @@
3664
"filename" : "icon-60@3x.png",
3765
"scale" : "3x"
3866
},
67+
{
68+
"idiom" : "ipad",
69+
"size" : "20x20",
70+
"scale" : "1x"
71+
},
72+
{
73+
"idiom" : "ipad",
74+
"size" : "20x20",
75+
"scale" : "2x"
76+
},
3977
{
4078
"size" : "29x29",
4179
"idiom" : "ipad",
@@ -60,6 +98,30 @@
6098
"filename" : "icon-40@2x~ipad.png",
6199
"scale" : "2x"
62100
},
101+
{
102+
"size" : "50x50",
103+
"idiom" : "ipad",
104+
"filename" : "icon-50~ipad.png",
105+
"scale" : "1x"
106+
},
107+
{
108+
"size" : "50x50",
109+
"idiom" : "ipad",
110+
"filename" : "icon-50@2x~ipad.png",
111+
"scale" : "2x"
112+
},
113+
{
114+
"size" : "72x72",
115+
"idiom" : "ipad",
116+
"filename" : "icon-72~ipad.png",
117+
"scale" : "1x"
118+
},
119+
{
120+
"size" : "72x72",
121+
"idiom" : "ipad",
122+
"filename" : "icon-72@2x~ipad.png",
123+
"scale" : "2x"
124+
},
63125
{
64126
"size" : "76x76",
65127
"idiom" : "ipad",

Examples/Applications/Applications/System.xcassets/AppIcon.appiconset/icon-29.png renamed to DZNEmptyDataSet/Applications/Assets.xcassets/AppIcon.appiconset/icon-29.png

File renamed without changes.

Examples/Applications/Applications/System.xcassets/AppIcon.appiconset/icon-29@2x.png renamed to DZNEmptyDataSet/Applications/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png

File renamed without changes.

Examples/Applications/Applications/System.xcassets/AppIcon.appiconset/icon-29@2x~ipad.png renamed to DZNEmptyDataSet/Applications/Assets.xcassets/AppIcon.appiconset/icon-29@2x~ipad.png

File renamed without changes.

0 commit comments

Comments
 (0)