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,117 @@
1
+ //
2
+ // CCIArgument.m
3
+ //
4
+ // Created by Ahmed Ali on 2/1/2016
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
+
25
+ // THE SOFTWARE. Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
26
+
27
+
28
+
29
+ #import "CCIArgument.h"
30
+
31
+ @interface CCIArgument ()
32
+ @end
33
+ @implementation CCIArgument
34
+
35
+
36
+
37
+
38
+ /**
39
+ * Instantiate the instance using the passed dictionary values to set the properties values
40
+ */
41
+
42
+ -(instancetype)initWithDictionary:(NSDictionary *)dictionary
43
+ {
44
+ self = [super init];
45
+
46
+
47
+ if(dictionary[@"content"] != nil && ![dictionary[@"content"] isKindOfClass:[NSNull class]]){
48
+ self.content = dictionary[@"content"];
49
+ }
50
+ if(dictionary[@"parsedRows"] != nil){
51
+ self.rows = dictionary[@"parsedRows"];
52
+ }else if(dictionary[@"rows"] != nil && [dictionary[@"rows"] isKindOfClass:[NSArray class]]){
53
+ NSArray * rowsDictionaries = dictionary[@"rows"];
54
+ NSMutableArray * rows = [NSMutableArray array];
55
+ for(NSDictionary * rowsDictionary in rowsDictionaries){
56
+ NSMutableArray * row = [NSMutableArray array];
57
+ for(NSDictionary * cell in rowsDictionary[@"cells"]){
58
+ [row addObject:cell[@"value"]];
59
+ }
60
+ [rows addObject:row];
61
+ }
62
+ if(rows.count > 0){
63
+ self.rows = rows;
64
+ }
65
+ }
66
+ return self;
67
+ }
68
+
69
+
70
+ /**
71
+ * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
72
+ */
73
+ -(NSDictionary *)toDictionary
74
+ {
75
+ NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
76
+
77
+ if(self.rows != nil){
78
+ dictionary[@"parsedRows"] = self.rows;
79
+ }
80
+
81
+ if(self.content != nil){
82
+ dictionary[@"content"] = self.content;
83
+ }
84
+ return dictionary;
85
+
86
+ }
87
+
88
+ /**
89
+ * Implementation of NSCoding encoding method
90
+ */
91
+ /**
92
+ * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
93
+ */
94
+ - (void)encodeWithCoder:(NSCoder *)aCoder
95
+ {
96
+ if(self.rows != nil){
97
+ [aCoder encodeObject:self.rows forKey:@"rows"];
98
+ }
99
+
100
+ if(self.content != nil){
101
+ [aCoder encodeObject:self.content forKey:@"content"];
102
+ }
103
+
104
+ }
105
+
106
+ /**
107
+ * Implementation of NSCoding initWithCoder: method
108
+ */
109
+ - (instancetype)initWithCoder:(NSCoder *)aDecoder
110
+ {
111
+ self = [super init];
112
+ self.rows = [aDecoder decodeObjectForKey:@"rows"];
113
+ self.content = [aDecoder decodeObjectForKey:@"content"];
114
+ return self;
115
+
116
+ }
117
+ @end
@@ -0,0 +1,37 @@
1
+ //
2
+ // CCIAroundHock.h
3
+ //
4
+ // Created by Ahmed Ali on 19/1/2016
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
+ #import "CCIBlockDefinitions.h"
28
+ @class CCIScenarioDefinition;
29
+
30
+
31
+ @interface CCIAroundHock : NSObject
32
+
33
+ @property (nonatomic, strong) NSArray * tags;
34
+ @property (nonatomic, copy) CCIScenarioExecutionHockBlock block;
35
+
36
+ + (instancetype)hockWithTags:(NSArray *)tags block:(CCIScenarioExecutionHockBlock)block;
37
+ @end
@@ -0,0 +1,37 @@
1
+ //
2
+ // CCIAroundHock.m
3
+ //
4
+ // Created by Ahmed Ali on 19/1/2016
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
+
27
+ #import "CCIAroundHock.h"
28
+
29
+ @implementation CCIAroundHock
30
+ + (instancetype)hockWithTags:(NSArray *)tags block:(CCIScenarioExecutionHockBlock)block
31
+ {
32
+ CCIAroundHock * hock = [CCIAroundHock new];
33
+ hock.block = block;
34
+ hock.tags = tags;
35
+ return hock;
36
+ }
37
+ @end
@@ -0,0 +1,46 @@
1
+ //
2
+ // CCIBackground.h
3
+ //
4
+ // Created by Ahmed Ali on 2/1/2016
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
+ // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
27
+
28
+ #import <Foundation/Foundation.h>
29
+ #import "CCILocation.h"
30
+ #import "CCIStep.h"
31
+
32
+ /**
33
+ Represents a feature background
34
+
35
+ Check the Backgroun wiki for detailed information https://github.com/Ahmed-Ali/Cucumberish/wiki/Background
36
+ */
37
+ @interface CCIBackground : NSObject
38
+
39
+ @property (nonatomic, strong) CCILocation * location;
40
+
41
+ @property (nonatomic, strong) NSArray * steps;
42
+
43
+ -(instancetype)initWithDictionary:(NSDictionary *)dictionary;
44
+
45
+ -(NSDictionary *)toDictionary;
46
+ @end
@@ -0,0 +1,117 @@
1
+ //
2
+ // CCIBackground.m
3
+ //
4
+ // Created by Ahmed Ali on 2/1/2016
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. Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
25
+
26
+
27
+
28
+ #import "CCIBackground.h"
29
+
30
+ @interface CCIBackground ()
31
+ @end
32
+ @implementation CCIBackground
33
+
34
+
35
+
36
+
37
+ /**
38
+ * Instantiate the instance using the passed dictionary values to set the properties values
39
+ */
40
+
41
+ -(instancetype)initWithDictionary:(NSDictionary *)dictionary
42
+ {
43
+ self = [super init];
44
+
45
+
46
+ if(dictionary[@"location"] != nil && ![dictionary[@"location"] isKindOfClass:[NSNull class]]){
47
+ self.location = [[CCILocation alloc] initWithDictionary:dictionary[@"location"]];
48
+ }
49
+
50
+
51
+ if(dictionary[@"steps"] != nil && [dictionary[@"steps"] isKindOfClass:[NSArray class]]){
52
+ NSArray * stepsDictionaries = dictionary[@"steps"];
53
+ NSMutableArray * stepsItems = [NSMutableArray array];
54
+ for(NSDictionary * stepsDictionary in stepsDictionaries){
55
+ CCIStep * stepsItem = [[CCIStep alloc] initWithDictionary:stepsDictionary];
56
+ [stepsItems addObject:stepsItem];
57
+ }
58
+ self.steps = stepsItems;
59
+ }
60
+
61
+ return self;
62
+ }
63
+
64
+
65
+ /**
66
+ * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
67
+ */
68
+ -(NSDictionary *)toDictionary
69
+ {
70
+ NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
71
+
72
+ if(self.location != nil){
73
+ dictionary[@"location"] = [self.location toDictionary];
74
+ }
75
+
76
+ if(self.steps != nil){
77
+ NSMutableArray * dictionaryElements = [NSMutableArray array];
78
+ for(CCIStep * stepsElement in self.steps){
79
+ [dictionaryElements addObject:[stepsElement toDictionary]];
80
+ }
81
+ dictionary[@"steps"] = dictionaryElements;
82
+ }
83
+ return dictionary;
84
+
85
+ }
86
+
87
+ /**
88
+ * Implementation of NSCoding encoding method
89
+ */
90
+ /**
91
+ * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
92
+ */
93
+ - (void)encodeWithCoder:(NSCoder *)aCoder
94
+ {
95
+
96
+ if(self.location != nil){
97
+ [aCoder encodeObject:self.location forKey:@"location"];
98
+ }
99
+
100
+ if(self.steps != nil){
101
+ [aCoder encodeObject:self.steps forKey:@"steps"];
102
+ }
103
+
104
+ }
105
+
106
+ /**
107
+ * Implementation of NSCoding initWithCoder: method
108
+ */
109
+ - (instancetype)initWithCoder:(NSCoder *)aDecoder
110
+ {
111
+ self = [super init];
112
+ self.location = [aDecoder decodeObjectForKey:@"location"];
113
+ self.steps = [aDecoder decodeObjectForKey:@"steps"];
114
+ return self;
115
+
116
+ }
117
+ @end
@@ -0,0 +1,89 @@
1
+ //
2
+ // CCIExample.h
3
+ //
4
+ // Created by Ahmed Ali on 17/1/2016
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
+ // Model file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
27
+
28
+ #import "CCILocation.h"
29
+
30
+ /**
31
+ Represents and example of a scanrio outline
32
+ */
33
+ @interface CCIExample : NSObject
34
+
35
+ /**
36
+ The location of the example in its file
37
+ */
38
+ @property (nonatomic, strong) CCILocation * location;
39
+
40
+ /**
41
+ Representaion of the example data where the dictionary keys are the table headers
42
+ each key will contain array of example column. E. g
43
+ @code
44
+ | Field 1 | Field 2 | Field 3 |
45
+ | C1Ro1 | C2Ro1 | C3Ro1 |
46
+ | C1Ro2 | C2Ro2 | C3Ro2 |
47
+ | C1Ro3 | C2Ro3 | C3Ro3 |
48
+
49
+ @endcode
50
+
51
+ This will end up with the example data with the following structure
52
+ @code
53
+ {
54
+ Field 1 : [
55
+ C1Ro1,
56
+ C1Ro2,
57
+ C1Ro3
58
+ ],
59
+ Field 2 : [
60
+ C2Ro1,
61
+ C2Ro2,
62
+ C2Ro3
63
+ ],
64
+ Field 3 : [
65
+ C3Ro1,
66
+ C3Ro2,
67
+ C3Ro3
68
+ ]
69
+ }
70
+ @endcode
71
+ */
72
+ @property (nonatomic, strong) NSDictionary * exampleData;
73
+
74
+ /**
75
+ Creates an instance with properties filled from the passed dictionary
76
+
77
+ @param dictionary the dictionary that contains all the example data
78
+
79
+ @return example instance
80
+ */
81
+ -(instancetype)initWithDictionary:(NSDictionary *)dictionary;
82
+
83
+ /**
84
+ Creates a dictionary from the class properties
85
+
86
+ @return the created dictionary
87
+ */
88
+ -(NSDictionary *)toDictionary;
89
+ @end