xcfit 2.0.4 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -9
  3. data/Docs/InitialVersion.md +340 -0
  4. data/Package.swift +5 -0
  5. data/README.md +348 -145
  6. data/XCFit.gemspec +1 -1
  7. data/XCFit.podspec +17 -9
  8. data/XCFit/Classes/Cucumberish/Core/CCIBlockDefinitions.h +400 -0
  9. data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.h +72 -0
  10. data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.m +141 -0
  11. data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.h +51 -0
  12. data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.m +245 -0
  13. data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.h +62 -0
  14. data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.m +117 -0
  15. data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.h +37 -0
  16. data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.m +37 -0
  17. data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.h +46 -0
  18. data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.m +117 -0
  19. data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.h +89 -0
  20. data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.m +128 -0
  21. data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.h +49 -0
  22. data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.m +174 -0
  23. data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.h +36 -0
  24. data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.m +34 -0
  25. data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.h +61 -0
  26. data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.m +91 -0
  27. data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.h +97 -0
  28. data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.m +224 -0
  29. data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.h +85 -0
  30. data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.m +98 -0
  31. data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.h +43 -0
  32. data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.m +65 -0
  33. data/XCFit/Classes/Cucumberish/Cucumberish.h +133 -0
  34. data/XCFit/Classes/Cucumberish/Cucumberish.m +604 -0
  35. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.h +15 -0
  36. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.m +312 -0
  37. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.h +20 -0
  38. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.m +79 -0
  39. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.h +12 -0
  40. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.m +18 -0
  41. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.h +11 -0
  42. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.m +27 -0
  43. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.h +14 -0
  44. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.m +30 -0
  45. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.h +14 -0
  46. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.m +29 -0
  47. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.h +24 -0
  48. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.m +49 -0
  49. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.h +24 -0
  50. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.m +50 -0
  51. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.h +25 -0
  52. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.m +64 -0
  53. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.h +9 -0
  54. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.m +124 -0
  55. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProviderProtocol.h +10 -0
  56. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.h +9 -0
  57. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.m +10 -0
  58. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.h +17 -0
  59. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.m +18 -0
  60. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.h +12 -0
  61. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.m +179 -0
  62. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineProtocol.h +64 -0
  63. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.h +9 -0
  64. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.m +26 -0
  65. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasDescriptionProtocol.h +8 -0
  66. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasLocationProtocol.h +8 -0
  67. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasRowsProtocol.h +8 -0
  68. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasStepsProtocol.h +8 -0
  69. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasTagsProtocol.h +8 -0
  70. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.h +12 -0
  71. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.m +41 -0
  72. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.h +4 -0
  73. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.m +5 -0
  74. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.h +10 -0
  75. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.m +18 -0
  76. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.h +132 -0
  77. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.m +2735 -0
  78. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.h +55 -0
  79. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.m +192 -0
  80. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.h +14 -0
  81. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.m +18 -0
  82. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.h +23 -0
  83. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.m +41 -0
  84. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition_Private.h +6 -0
  85. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.h +15 -0
  86. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.m +26 -0
  87. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.h +16 -0
  88. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.m +35 -0
  89. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.h +4 -0
  90. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.m +5 -0
  91. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.h +13 -0
  92. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.m +28 -0
  93. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.h +13 -0
  94. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.m +29 -0
  95. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.h +13 -0
  96. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.m +28 -0
  97. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.h +26 -0
  98. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.m +50 -0
  99. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.h +29 -0
  100. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.m +283 -0
  101. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.h +12 -0
  102. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.m +59 -0
  103. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.h +7 -0
  104. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.m +28 -0
  105. data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/gherkin-languages.json +2969 -0
  106. data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.h +24 -0
  107. data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.m +44 -0
  108. data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.h +7 -0
  109. data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.m +83 -0
  110. data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.h +32 -0
  111. data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.m +70 -0
  112. data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +13 -0
  113. data/Xcode7-Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +11 -0
  114. data/lib/XCFit/version.rb +1 -1
  115. metadata +108 -38
  116. data/XCFit/Assets/.gitkeep +0 -0
  117. data/XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/TemplateIcon.png +0 -0
  118. data/XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/TemplateIcon@2x.png +0 -0
  119. data/XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/TemplateInfo.plist +0 -22
  120. data/XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/___FILEBASENAME___.feature +0 -20
  121. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h +0 -1
  122. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift +0 -31
  123. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h +0 -28
  124. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
  125. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
  126. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist +0 -150
  127. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -1
  128. data/XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -15
  129. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
  130. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
  131. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/TemplateInfo.plist +0 -123
  132. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -7
  133. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.feature +0 -11
  134. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +0 -14
  135. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -17
  136. data/XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -23
  137. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
  138. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
  139. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +0 -123
  140. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -7
  141. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.feature +0 -11
  142. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +0 -14
  143. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -17
  144. data/XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -25
  145. data/XCFit/Assets/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
  146. data/XCFit/Assets/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -54
  147. data/XCFit/Assets/XCFit/MacOS API Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
  148. data/XCFit/Assets/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
  149. data/XCFit/Assets/XCFit/iOS API Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
  150. data/XCFit/Assets/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist +0 -52
  151. data/XCFit/Assets/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
@@ -0,0 +1,24 @@
1
+ //
2
+ // NSArray+Hashes.h
3
+ // CucumberishExample
4
+ //
5
+ // Created by David Siebecker on 7/26/16.
6
+ // Copyright © 2016 Ahmed Ali. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+
11
+ @interface NSArray (Hashes)
12
+ /**
13
+ * Converts an NSArray<NSArray> to an array of dictionaries where the keys for the dictionary are the elements in the first array in self
14
+ * @return the row hashes
15
+ */
16
+ -(NSArray*)rowHashes;
17
+
18
+ /**
19
+ * Converts an NSArray<NSArray> to an array of dictionaries where the kesy for the dictionary are the first elements in each array in self
20
+ * @return the column hashes
21
+ */
22
+ -(NSArray*)columnHashes;
23
+
24
+ @end
@@ -0,0 +1,44 @@
1
+ //
2
+ // NSArray+Hashes.m
3
+ // CucumberishExample
4
+ //
5
+ // Created by David Siebecker on 7/26/16.
6
+ // Copyright © 2016 Ahmed Ali. All rights reserved.
7
+ //
8
+
9
+ #import "NSArray+Hashes.h"
10
+
11
+ @implementation NSArray (Hashes)
12
+
13
+ -(NSArray *)rowHashes
14
+ {
15
+ NSMutableArray *array = [NSMutableArray arrayWithCapacity:self.count];
16
+ NSArray *keys = self[0];
17
+ for (NSInteger i = 1; i < self.count; i++) {
18
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
19
+ NSArray *values = self[i];
20
+ [keys enumerateObjectsUsingBlock:^(NSString * _Nonnull key, NSUInteger idx, BOOL * _Nonnull stop) {
21
+ dict[key] = values[idx];
22
+ }];
23
+ [array addObject:dict];
24
+ }
25
+ return array;
26
+ }
27
+
28
+ -(NSArray *)columnHashes
29
+ {
30
+ NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self[0] count]-1];
31
+ NSArray *keys = [self valueForKey:@"firstObject"];
32
+ for (NSInteger i = 0; i < keys.count; i++) {
33
+ NSMutableDictionary *dict = [NSMutableDictionary dictionary];
34
+ [self enumerateObjectsUsingBlock:^(NSString * _Nonnull key, NSUInteger idx, BOOL * _Nonnull stop) {
35
+ if (idx != 0) {
36
+ dict[key] = self[i][idx];
37
+ }
38
+ }];
39
+ [array addObject:dict];
40
+ }
41
+ return array;
42
+ }
43
+
44
+ @end
@@ -0,0 +1,7 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+ @interface NSObject (Dictionary)
4
+
5
+ - (NSDictionary *)dictionary;
6
+
7
+ @end
@@ -0,0 +1,83 @@
1
+ #import "NSObject+Dictionary.h"
2
+
3
+ #import "GHHasLocationProtocol.h"
4
+
5
+ #import <objc/runtime.h>
6
+
7
+ @implementation NSObject (Dictionary)
8
+
9
+ static NSDateFormatter * dateFormatter;
10
+
11
+ + (NSDateFormatter *)dateFormatter
12
+ {
13
+ if (!dateFormatter)
14
+ {
15
+ dateFormatter = [[NSDateFormatter alloc] init];
16
+ [dateFormatter setDateFormat: @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];
17
+ [dateFormatter setLocale: [[NSLocale alloc] initWithLocaleIdentifier: @"en_US_POSIX"]];
18
+ }
19
+ return dateFormatter;
20
+ }
21
+
22
+ - (NSDictionary *)dictionary
23
+ {
24
+ NSMutableDictionary * dictionary = [[NSMutableDictionary alloc] init];
25
+
26
+ unsigned int count;
27
+ Class currentClass = [self class];
28
+ while (currentClass != [NSObject class])
29
+ {
30
+ Ivar * ivars = class_copyIvarList(currentClass, &count);
31
+
32
+ for (int i = 0; i < count; i++)
33
+ {
34
+ NSString * propertyName = [NSString stringWithUTF8String:ivar_getName(ivars[i])];
35
+ id object = [self valueForKey: propertyName];
36
+
37
+ // Ugly fix to replace "desc" properties by "description" because the ToString() method is named "description" in ObjC...
38
+ if ([propertyName isEqualToString: @"desc"])
39
+ propertyName = @"description";
40
+
41
+ if (object)
42
+ {
43
+ if ([object isKindOfClass:[NSArray class]] || [object isKindOfClass:[NSSet class]])
44
+ {
45
+ NSMutableArray * subObjectsBuffer = [[NSMutableArray alloc] init];
46
+ for (NSObject * subObject in object)
47
+ {
48
+ [subObjectsBuffer addObject: [subObject dictionary]];
49
+ }
50
+ dictionary[propertyName] = [[NSArray alloc] initWithArray: subObjectsBuffer];
51
+ }
52
+ else if ([object isKindOfClass:[NSDictionary class]])
53
+ {
54
+ NSMutableDictionary * subObjectsBuffer = [[NSMutableDictionary alloc] init];
55
+ for (id key in object)
56
+ {
57
+ NSObject * subObject = [object objectForKey: key];
58
+ [subObjectsBuffer setObject: [subObject dictionary] forKey: key];
59
+ }
60
+ dictionary[propertyName] = [[NSDictionary alloc] initWithDictionary: subObjectsBuffer];
61
+ }
62
+ else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]])
63
+ dictionary[propertyName] = object;
64
+ else if ([object isKindOfClass:[NSDate class]])
65
+ dictionary[propertyName] = [[NSObject dateFormatter] stringFromDate:(NSDate *) object];
66
+ else if ([object isKindOfClass: [NSObject class]])
67
+ dictionary[propertyName] = [object dictionary];
68
+ }
69
+
70
+ }
71
+
72
+ free(ivars);
73
+ currentClass = class_getSuperclass(currentClass);
74
+ }
75
+
76
+ // Add type based on class name to the dictionary
77
+ if ([[self class] conformsToProtocol: @protocol(GHHasLocationProtocol)])
78
+ [dictionary setObject: [NSStringFromClass([self class]) stringByReplacingOccurrencesOfString: @"GH" withString: @""] forKey: @"type"];
79
+
80
+ return dictionary;
81
+ }
82
+
83
+ @end
@@ -0,0 +1,32 @@
1
+ //
2
+ // NSString+Formatter.h
3
+ //
4
+ // Created by Ahmed Ali on 11/01/16.
5
+ // Copyright © 2016 Ahmed Ali. All rights reserved.
6
+ //
7
+ //
8
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ // of this software and associated documentation files (the "Software"), to deal
10
+ // in the Software without restriction, including without limitation the rights
11
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ // copies of the Software, and to permit persons to whom the Software is
13
+ // furnished to do so, subject to the following conditions:
14
+ //
15
+ // The above copyright notice and this permission notice shall be included in
16
+ // all copies or substantial portions of the Software.
17
+ //
18
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ // THE SOFTWARE.
25
+
26
+ #import <Foundation/Foundation.h>
27
+
28
+ @interface NSString (Formatter)
29
+
30
+ - (NSString *)camleCaseStringWithFirstUppercaseCharacter:(BOOL)firstUppercaseCharacter;
31
+
32
+ @end
@@ -0,0 +1,70 @@
1
+ //
2
+ // NSString+Formatter.m
3
+
4
+ // Created by Ahmed Ali on 11/01/16.
5
+ // Copyright © 2016 Ahmed Ali. All rights reserved.
6
+ //
7
+ //
8
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ // of this software and associated documentation files (the "Software"), to deal
10
+ // in the Software without restriction, including without limitation the rights
11
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ // copies of the Software, and to permit persons to whom the Software is
13
+ // furnished to do so, subject to the following conditions:
14
+ //
15
+ // The above copyright notice and this permission notice shall be included in
16
+ // all copies or substantial portions of the Software.
17
+ //
18
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ // THE SOFTWARE.
25
+
26
+ #import "NSString+Formatter.h"
27
+
28
+ @implementation NSString (Formatter)
29
+ - (NSString *)camleCaseStringWithFirstUppercaseCharacter:(BOOL)firstUppercaseCharacter
30
+ {
31
+ static NSString * sep = @"AASSAAAKKKAALLLAL";
32
+ NSString * str = [[self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] stringByReplacingOccurrencesOfString:@" " withString:sep];
33
+ str = [str stringByReplacingCharactersInSet:[[NSCharacterSet alphanumericCharacterSet] invertedSet] withString:@""];
34
+ str = [str stringByReplacingOccurrencesOfString:sep withString:@"_"];
35
+ NSMutableString * output = [NSMutableString string];
36
+ BOOL makeNextCharacterInUpperCase = firstUppercaseCharacter;
37
+ for (int i = 0; i < str.length; i++) {
38
+
39
+ NSString * substr = [str substringWithRange:NSMakeRange(i, 1)];
40
+ if(i == 0 && !makeNextCharacterInUpperCase){
41
+ substr = [substr lowercaseString];
42
+ }
43
+ if([substr isEqualToString:@"_"]){
44
+ makeNextCharacterInUpperCase = YES;
45
+ continue;
46
+ }else if(makeNextCharacterInUpperCase){
47
+ substr = [substr uppercaseString];
48
+
49
+ }
50
+ [output appendString:substr];
51
+ makeNextCharacterInUpperCase = NO;
52
+ }
53
+
54
+ return output;
55
+ }
56
+
57
+ - (NSString *)stringByReplacingCharactersInSet:(NSCharacterSet *)charSet withString:(NSString *)aString {
58
+ NSMutableString *s = [NSMutableString stringWithCapacity:self.length];
59
+ for (NSUInteger i = 0; i < self.length; ++i) {
60
+ unichar c = [self characterAtIndex:i];
61
+ if (![charSet characterIsMember:c]) {
62
+ [s appendFormat:@"%C", c];
63
+ } else {
64
+ [s appendString:aString];
65
+ }
66
+ }
67
+ return s;
68
+ }
69
+
70
+ @end
@@ -12,6 +12,19 @@
12
12
  </array>
13
13
  <key>TargetOnly</key>
14
14
  <true/>
15
+ <key>AssociatedTargetSpecification</key>
16
+ <dict>
17
+ <key>PopUpTitle</key>
18
+ <string>Target to be Tested:</string>
19
+ <key>PopUpDescription</key>
20
+ <string>The application that this new test bundle will be testing. The new UI Tests will be associated with that target&apos;s scheme.</string>
21
+ <key>AllowableProductTypes</key>
22
+ <array>
23
+ <string>com.apple.product-type.application</string>
24
+ </array>
25
+ <key>AssociatedTargetIsTargetToBeTested</key>
26
+ <true/>
27
+ </dict>
15
28
  <key>Targets</key>
16
29
  <array>
17
30
  <dict>
@@ -24,5 +24,16 @@
24
24
  <string>com.apple.dt.cocoaUITestBundleTarget</string>
25
25
  </dict>
26
26
  </array>
27
+ <key>OptionConstraints</key>
28
+ <array>
29
+ <dict>
30
+ <key>Identifier</key>
31
+ <string>productName</string>
32
+ <key>ConstraintType</key>
33
+ <string>DefaultIfAssociatedTarget</string>
34
+ <key>Value</key>
35
+ <string>___ASSOCIATEDTARGET_bundleName___CucumberTests</string>
36
+ </dict>
37
+ </array>
27
38
  </dict>
28
39
  </plist>
data/lib/XCFit/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module XCFit
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcfit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shashikant86
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-20 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -65,54 +65,124 @@ files:
65
65
  - .gitignore
66
66
  - .travis.yml
67
67
  - Dangerfile
68
+ - Docs/InitialVersion.md
68
69
  - Docs/Xcode7.md
69
70
  - Docs/xcdoe7swift2.md
70
71
  - Gemfile
71
72
  - Gemfile.lock
72
73
  - LICENSE
74
+ - Package.swift
73
75
  - README.md
74
76
  - Rakefile
75
77
  - XCFit.gemspec
76
78
  - XCFit.podspec
77
- - XCFit/Assets/.gitkeep
78
- - XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/TemplateIcon.png
79
- - XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/TemplateIcon@2x.png
80
- - XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/TemplateInfo.plist
81
- - XCFit/Assets/Gherkin/Cucumber Feature.xctemplate/___FILEBASENAME___.feature
82
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h
83
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift
84
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h
85
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/TemplateIcon.png
86
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/TemplateIcon@2x.png
87
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist
88
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h
89
- - XCFit/Assets/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m
90
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/TemplateIcon.png
91
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/TemplateIcon@2x.png
92
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/TemplateInfo.plist
93
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h
94
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.feature
95
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h
96
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m
97
- - XCFit/Assets/XCFit/Cucumberish API Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift
98
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png
99
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png
100
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist
101
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h
102
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.feature
103
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h
104
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m
105
- - XCFit/Assets/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift
106
- - XCFit/Assets/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib
107
- - XCFit/Assets/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist
108
- - XCFit/Assets/XCFit/MacOS API Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
109
- - XCFit/Assets/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
110
- - XCFit/Assets/XCFit/iOS API Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
111
- - XCFit/Assets/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist
112
- - XCFit/Assets/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist
113
79
  - XCFit/Classes/.gitkeep
114
80
  - XCFit/Classes/CliSwift.swift
115
81
  - XCFit/Classes/CopyDir.swift
82
+ - XCFit/Classes/Cucumberish/Core/CCIBlockDefinitions.h
83
+ - XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.h
84
+ - XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.m
85
+ - XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.h
86
+ - XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.m
87
+ - XCFit/Classes/Cucumberish/Core/Models/CCIArgument.h
88
+ - XCFit/Classes/Cucumberish/Core/Models/CCIArgument.m
89
+ - XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.h
90
+ - XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.m
91
+ - XCFit/Classes/Cucumberish/Core/Models/CCIBackground.h
92
+ - XCFit/Classes/Cucumberish/Core/Models/CCIBackground.m
93
+ - XCFit/Classes/Cucumberish/Core/Models/CCIExample.h
94
+ - XCFit/Classes/Cucumberish/Core/Models/CCIExample.m
95
+ - XCFit/Classes/Cucumberish/Core/Models/CCIFeature.h
96
+ - XCFit/Classes/Cucumberish/Core/Models/CCIFeature.m
97
+ - XCFit/Classes/Cucumberish/Core/Models/CCIHock.h
98
+ - XCFit/Classes/Cucumberish/Core/Models/CCIHock.m
99
+ - XCFit/Classes/Cucumberish/Core/Models/CCILocation.h
100
+ - XCFit/Classes/Cucumberish/Core/Models/CCILocation.m
101
+ - XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.h
102
+ - XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.m
103
+ - XCFit/Classes/Cucumberish/Core/Models/CCIStep.h
104
+ - XCFit/Classes/Cucumberish/Core/Models/CCIStep.m
105
+ - XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.h
106
+ - XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.m
107
+ - XCFit/Classes/Cucumberish/Cucumberish.h
108
+ - XCFit/Classes/Cucumberish/Cucumberish.m
109
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.h
110
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.m
111
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.h
112
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.m
113
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.h
114
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.m
115
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.h
116
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.m
117
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.h
118
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.m
119
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.h
120
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.m
121
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.h
122
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.m
123
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.h
124
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.m
125
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.h
126
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.m
127
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.h
128
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.m
129
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProviderProtocol.h
130
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.h
131
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.m
132
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.h
133
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.m
134
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.h
135
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.m
136
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineProtocol.h
137
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.h
138
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.m
139
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasDescriptionProtocol.h
140
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasLocationProtocol.h
141
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasRowsProtocol.h
142
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasStepsProtocol.h
143
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasTagsProtocol.h
144
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.h
145
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.m
146
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.h
147
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.m
148
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.h
149
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.m
150
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.h
151
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.m
152
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.h
153
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.m
154
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.h
155
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.m
156
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.h
157
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.m
158
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition_Private.h
159
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.h
160
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.m
161
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.h
162
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.m
163
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.h
164
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.m
165
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.h
166
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.m
167
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.h
168
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.m
169
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.h
170
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.m
171
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.h
172
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.m
173
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.h
174
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.m
175
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.h
176
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.m
177
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.h
178
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.m
179
+ - XCFit/Classes/Cucumberish/Dependencies/Gherkin/gherkin-languages.json
180
+ - XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.h
181
+ - XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.m
182
+ - XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.h
183
+ - XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.m
184
+ - XCFit/Classes/Cucumberish/Utils/NSString+Formatter.h
185
+ - XCFit/Classes/Cucumberish/Utils/NSString+Formatter.m
116
186
  - XCFit_Templates/Gherkin/Cucumber Feature.xctemplate/TemplateIcon.png
117
187
  - XCFit_Templates/Gherkin/Cucumber Feature.xctemplate/TemplateIcon@2x.png
118
188
  - XCFit_Templates/Gherkin/Cucumber Feature.xctemplate/TemplateInfo.plist