xcfit 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.swift-version +1 -0
- data/.travis.yml +13 -13
- data/README.md +57 -35
- data/XCFit.podspec +6 -16
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +14 -12
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +16 -15
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +11 -11
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +5 -5
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +9 -8
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +7 -6
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +7 -5
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +10 -8
- data/homebrew/xcfit +155 -0
- data/lib/XCFit/version.rb +1 -1
- metadata +15 -177
- data/XCFit/Classes/.gitkeep +0 -0
- data/XCFit/Classes/CliSwift.swift +0 -87
- data/XCFit/Classes/CopyDir.swift +0 -26
- data/XCFit/Classes/Cucumberish/Core/CCIBlockDefinitions.h +0 -400
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.h +0 -72
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.m +0 -141
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.h +0 -51
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.m +0 -245
- data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.h +0 -62
- data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.m +0 -117
- data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.h +0 -37
- data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.m +0 -37
- data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.h +0 -46
- data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.m +0 -117
- data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.h +0 -89
- data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.m +0 -128
- data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.h +0 -49
- data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.m +0 -174
- data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.h +0 -36
- data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.m +0 -34
- data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.h +0 -61
- data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.m +0 -91
- data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.h +0 -97
- data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.m +0 -224
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.h +0 -85
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.m +0 -98
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.h +0 -43
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.m +0 -65
- data/XCFit/Classes/Cucumberish/Cucumberish.h +0 -133
- data/XCFit/Classes/Cucumberish/Cucumberish.m +0 -604
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.h +0 -15
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.m +0 -312
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.h +0 -20
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.m +0 -79
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.h +0 -11
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.m +0 -27
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.h +0 -14
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.m +0 -30
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.h +0 -14
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.m +0 -29
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.h +0 -24
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.m +0 -49
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.h +0 -24
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.m +0 -50
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.h +0 -25
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.m +0 -64
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.h +0 -9
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.m +0 -124
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProviderProtocol.h +0 -10
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.h +0 -9
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.m +0 -10
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.h +0 -17
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.m +0 -179
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineProtocol.h +0 -64
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.h +0 -9
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.m +0 -26
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasDescriptionProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasLocationProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasRowsProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasStepsProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasTagsProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.m +0 -41
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.h +0 -4
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.m +0 -5
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.h +0 -10
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.h +0 -132
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.m +0 -2735
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.h +0 -55
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.m +0 -192
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.h +0 -14
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.h +0 -23
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.m +0 -41
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition_Private.h +0 -6
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.h +0 -15
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.m +0 -26
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.h +0 -16
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.m +0 -35
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.h +0 -4
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.m +0 -5
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.h +0 -13
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.m +0 -28
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.h +0 -13
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.m +0 -29
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.h +0 -13
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.m +0 -28
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.h +0 -26
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.m +0 -50
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.h +0 -29
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.m +0 -283
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.m +0 -59
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.h +0 -7
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.m +0 -28
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/gherkin-languages.json +0 -2969
- data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.h +0 -24
- data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.m +0 -44
- data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.h +0 -7
- data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.m +0 -83
- data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.h +0 -32
- data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.m +0 -70
- data/XCFit_Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/XCFit_Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
- data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
- data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
- data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -61
- data/XCFit_Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -134
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -17
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -13
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___POD_NAME___.m +0 -25
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h +0 -1
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift +0 -35
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h +0 -28
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist +0 -155
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -12
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -33
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +0 -41
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +0 -92
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +0 -58
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +0 -24
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +0 -28
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +0 -26
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +0 -159
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -15
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +0 -23
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -28
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -37
- data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -61
- data/Xcode7-Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift +0 -42
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift +0 -60
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift +0 -31
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift +0 -25
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift +0 -24
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift +0 -30
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift +0 -45
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist +0 -141
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift +0 -30
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon-old.icns +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon-old.icns +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist +0 -59
- data/Xcode7-Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
- data/Xcode7-Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist +0 -39
@@ -1,55 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@class GHLocation;
|
3
|
-
@class GHToken;
|
4
|
-
|
5
|
-
@interface GHParserException : NSException
|
6
|
-
|
7
|
-
@property (nonatomic, readonly) GHLocation * location;
|
8
|
-
|
9
|
-
@end
|
10
|
-
|
11
|
-
@interface GHAstBuilderException : GHParserException
|
12
|
-
|
13
|
-
- (id)initWithMessage:(NSString *)theMessage;
|
14
|
-
- (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation;
|
15
|
-
|
16
|
-
@end
|
17
|
-
|
18
|
-
@interface GHNoSuchLanguageException : GHParserException
|
19
|
-
|
20
|
-
- (id)initWithLanguage:(NSString *)theLanguage location:(GHLocation *)theLocation;
|
21
|
-
|
22
|
-
@end
|
23
|
-
|
24
|
-
@interface GHTokenParserException : GHParserException
|
25
|
-
|
26
|
-
- (id)initWithMessage:(NSString *)theMessage token:(GHToken *)theToken;
|
27
|
-
|
28
|
-
@end
|
29
|
-
|
30
|
-
@interface GHUnexpectedTokenException : GHTokenParserException
|
31
|
-
|
32
|
-
@property (nonatomic, readonly) NSString * stateComment;
|
33
|
-
@property (nonatomic, readonly) GHToken * receivedToken;
|
34
|
-
@property (nonatomic, readonly) NSArray<NSString *> * expectedTokenTypes;
|
35
|
-
|
36
|
-
- (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment;
|
37
|
-
|
38
|
-
@end
|
39
|
-
|
40
|
-
@interface GHUnexpectedEOFException : GHTokenParserException
|
41
|
-
|
42
|
-
@property (nonatomic, readonly) NSString * stateComment;
|
43
|
-
@property (nonatomic, readonly) NSArray<NSString *> * expectedTokenTypes;
|
44
|
-
|
45
|
-
- (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment;
|
46
|
-
|
47
|
-
@end
|
48
|
-
|
49
|
-
@interface GHCompositeParserException : GHParserException
|
50
|
-
|
51
|
-
@property (nonatomic, readonly) NSArray<GHParserException *> * errors;
|
52
|
-
|
53
|
-
- (id)initWithErrors:(NSArray<GHParserException *> *)theErrors;
|
54
|
-
|
55
|
-
@end
|
@@ -1,192 +0,0 @@
|
|
1
|
-
#import "GHParserException.h"
|
2
|
-
|
3
|
-
#import "GHLocation.h"
|
4
|
-
#import "GHToken.h"
|
5
|
-
|
6
|
-
@interface GHParserException ()
|
7
|
-
|
8
|
-
@property (nonatomic, strong) GHLocation * location;
|
9
|
-
|
10
|
-
- (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation;
|
11
|
-
|
12
|
-
@end
|
13
|
-
|
14
|
-
@implementation GHParserException
|
15
|
-
|
16
|
-
@synthesize location;
|
17
|
-
|
18
|
-
- (id)initWithMessage:(NSString *)theMessage
|
19
|
-
{
|
20
|
-
return [super initWithName: NSParseErrorException reason: theMessage userInfo: nil];
|
21
|
-
}
|
22
|
-
|
23
|
-
- (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation
|
24
|
-
{
|
25
|
-
NSAssert(theLocation != nil, @"Location should not be nil");
|
26
|
-
|
27
|
-
if (self = [super initWithName: NSParseErrorException reason: [[self class] message: theMessage withLocation: theLocation] userInfo: nil])
|
28
|
-
{
|
29
|
-
location = theLocation;
|
30
|
-
}
|
31
|
-
|
32
|
-
return self;
|
33
|
-
}
|
34
|
-
|
35
|
-
+ (NSString *)message:(NSString *)theMessage withLocation:(GHLocation *)theLocation
|
36
|
-
{
|
37
|
-
NSAssert(theLocation != nil, @"Location should not be nil");
|
38
|
-
|
39
|
-
return [NSString stringWithFormat: @"(%d:%d): %@", (int)[theLocation line], (int)[theLocation column], theMessage];
|
40
|
-
}
|
41
|
-
|
42
|
-
@end
|
43
|
-
|
44
|
-
@implementation GHAstBuilderException
|
45
|
-
|
46
|
-
- (id)initWithMessage:(NSString *)theMessage
|
47
|
-
{
|
48
|
-
NSAssert(theMessage != nil, @"Message should not be nil");
|
49
|
-
|
50
|
-
return [super initWithMessage: theMessage];
|
51
|
-
}
|
52
|
-
|
53
|
-
- (id)initWithMessage:(NSString *)theMessage location:(GHLocation *)theLocation
|
54
|
-
{
|
55
|
-
NSAssert(theLocation != nil, @"Location should not be nil");
|
56
|
-
NSAssert(theMessage != nil, @"Location should not be nil");
|
57
|
-
|
58
|
-
return [super initWithMessage: theMessage location: theLocation];
|
59
|
-
}
|
60
|
-
|
61
|
-
@end
|
62
|
-
|
63
|
-
@implementation GHNoSuchLanguageException
|
64
|
-
|
65
|
-
- (id)initWithLanguage:(NSString *)theLanguage location:(GHLocation *)theLocation
|
66
|
-
{
|
67
|
-
return [super initWithMessage: [@"Language not supported: " stringByAppendingString: theLanguage] location: theLocation];
|
68
|
-
}
|
69
|
-
|
70
|
-
@end
|
71
|
-
|
72
|
-
@implementation GHTokenParserException
|
73
|
-
|
74
|
-
- (id)initWithMessage:(NSString *)theMessage token:(GHToken *)theToken
|
75
|
-
{
|
76
|
-
return [super initWithMessage: theMessage location: [[self class] locationWithToken: theToken]];
|
77
|
-
}
|
78
|
-
|
79
|
-
+ (GHLocation *)locationWithToken:(GHToken *)theReceivedToken
|
80
|
-
{
|
81
|
-
return [theReceivedToken isEOF] || [[theReceivedToken location] column] > 1
|
82
|
-
? [theReceivedToken location]
|
83
|
-
: [[GHLocation alloc] initWithLine: [[theReceivedToken location] line] column: [[theReceivedToken line] indent] + 1];
|
84
|
-
}
|
85
|
-
|
86
|
-
@end
|
87
|
-
|
88
|
-
@interface GHUnexpectedTokenException ()
|
89
|
-
|
90
|
-
@property (nonatomic, strong) NSString * stateComment;
|
91
|
-
@property (nonatomic, strong) GHToken * receivedToken;
|
92
|
-
@property (nonatomic, strong) NSArray<NSString *> * expectedTokenTypes;
|
93
|
-
|
94
|
-
@end
|
95
|
-
|
96
|
-
@implementation GHUnexpectedTokenException
|
97
|
-
|
98
|
-
@synthesize stateComment;
|
99
|
-
@synthesize receivedToken;
|
100
|
-
@synthesize expectedTokenTypes;
|
101
|
-
|
102
|
-
- (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment
|
103
|
-
{
|
104
|
-
NSAssert(theReceivedToken != nil, @"receivedToken should not be nil");
|
105
|
-
NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes should not be nil");
|
106
|
-
|
107
|
-
if (self = [super initWithMessage: [[self class] messageWithToken: theReceivedToken expectedTokenTypes: theExpectedTokenTypes] token: theReceivedToken])
|
108
|
-
{
|
109
|
-
receivedToken = theReceivedToken;
|
110
|
-
expectedTokenTypes = theExpectedTokenTypes;
|
111
|
-
stateComment = theStateComment;
|
112
|
-
}
|
113
|
-
|
114
|
-
return self;
|
115
|
-
}
|
116
|
-
|
117
|
-
+ (NSString *)messageWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes
|
118
|
-
{
|
119
|
-
NSAssert(theReceivedToken != nil, @"receivedToken");
|
120
|
-
NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes");
|
121
|
-
|
122
|
-
return [NSString stringWithFormat: @"expected: %@, got '%@'", [theExpectedTokenTypes componentsJoinedByString: @", "], [[theReceivedToken tokenValue] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]];
|
123
|
-
}
|
124
|
-
|
125
|
-
@end
|
126
|
-
|
127
|
-
@interface GHUnexpectedEOFException ()
|
128
|
-
|
129
|
-
@property (nonatomic, strong) NSString * stateComment;
|
130
|
-
@property (nonatomic, strong) NSArray<NSString *> * expectedTokenTypes;
|
131
|
-
|
132
|
-
@end
|
133
|
-
|
134
|
-
@implementation GHUnexpectedEOFException
|
135
|
-
|
136
|
-
@synthesize stateComment;
|
137
|
-
@synthesize expectedTokenTypes;
|
138
|
-
|
139
|
-
- (id)initWithToken:(GHToken *)theReceivedToken expectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes stateComment:(NSString *)theStateComment
|
140
|
-
{
|
141
|
-
NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes should not be nil");
|
142
|
-
|
143
|
-
if (self = [super initWithMessage: [[self class] messageWithExpectedTokenTypes: theExpectedTokenTypes] token: theReceivedToken])
|
144
|
-
{
|
145
|
-
expectedTokenTypes = theExpectedTokenTypes;
|
146
|
-
stateComment = theStateComment;
|
147
|
-
}
|
148
|
-
|
149
|
-
return self;
|
150
|
-
}
|
151
|
-
|
152
|
-
+ (NSString *)messageWithExpectedTokenTypes:(NSArray<NSString *> *)theExpectedTokenTypes
|
153
|
-
{
|
154
|
-
NSAssert(theExpectedTokenTypes != nil, @"expectedTokenTypes should not be nil");
|
155
|
-
|
156
|
-
return [NSString stringWithFormat: @"unexpected end of file, expected: %@", [theExpectedTokenTypes componentsJoinedByString: @", "]];
|
157
|
-
}
|
158
|
-
|
159
|
-
@end
|
160
|
-
|
161
|
-
|
162
|
-
@interface GHCompositeParserException ()
|
163
|
-
|
164
|
-
@property (nonatomic, strong) NSArray<GHParserException *> * errors;
|
165
|
-
|
166
|
-
@end
|
167
|
-
|
168
|
-
@implementation GHCompositeParserException
|
169
|
-
|
170
|
-
@synthesize errors;
|
171
|
-
|
172
|
-
- (id)initWithErrors:(NSArray<GHParserException *> *)theErrors
|
173
|
-
{
|
174
|
-
NSAssert([theErrors count] != 0, @"Errors list should not be nil or empty");
|
175
|
-
|
176
|
-
if (self = [super initWithMessage: [[self class] messageWithErrors: theErrors]])
|
177
|
-
{
|
178
|
-
errors = theErrors;
|
179
|
-
}
|
180
|
-
|
181
|
-
return self;
|
182
|
-
}
|
183
|
-
|
184
|
-
+ (NSString *)messageWithErrors:(NSArray<GHParserException *> *)theErrors
|
185
|
-
{
|
186
|
-
if (!theErrors)
|
187
|
-
@throw [NSException exceptionWithName: NSInvalidArgumentException reason: @"errors list should not be null" userInfo: nil];
|
188
|
-
|
189
|
-
return [@"Parser errors:\n" stringByAppendingString: [[theErrors valueForKey: @"reason"] componentsJoinedByString: @"\n"]];
|
190
|
-
}
|
191
|
-
|
192
|
-
@end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHScenarioDefinition.h"
|
3
|
-
|
4
|
-
@class GHTag;
|
5
|
-
@class GHLocation;
|
6
|
-
@class GHStep;
|
7
|
-
|
8
|
-
@interface GHScenario : GHScenarioDefinition
|
9
|
-
|
10
|
-
@property (nonatomic, readonly) NSArray<GHTag *> * tags;
|
11
|
-
|
12
|
-
- (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps;
|
13
|
-
|
14
|
-
@end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
#import "GHScenario.h"
|
2
|
-
|
3
|
-
#import "GHScenarioDefinition_Private.h"
|
4
|
-
|
5
|
-
#import "GHLocation.h"
|
6
|
-
|
7
|
-
@implementation GHScenario
|
8
|
-
@synthesize tags;
|
9
|
-
- (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps
|
10
|
-
{
|
11
|
-
|
12
|
-
self = [super initWithLocation: theLocation keyword: theKeyword name: theName description: theDescription steps: theSteps];
|
13
|
-
tags = theTags;
|
14
|
-
return self;
|
15
|
-
}
|
16
|
-
|
17
|
-
@end
|
18
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHHasLocationProtocol.h"
|
3
|
-
#import "GHHasDescriptionProtocol.h"
|
4
|
-
#import "GHHasStepsProtocol.h"
|
5
|
-
#import "GHHasTagsProtocol.h"
|
6
|
-
|
7
|
-
@class GHTag;
|
8
|
-
@class GHLocation;
|
9
|
-
@class GHStep;
|
10
|
-
|
11
|
-
@interface GHScenarioDefinition : NSObject <GHHasLocationProtocol, GHHasDescriptionProtocol, GHHasStepsProtocol, GHHasTagsProtocol>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
@property (nonatomic, readonly) GHLocation * location;
|
16
|
-
@property (nonatomic, readonly) NSString * keyword;
|
17
|
-
@property (nonatomic, readonly) NSString * name;
|
18
|
-
@property (nonatomic, readonly) NSString * desc;
|
19
|
-
@property (nonatomic, readonly) NSArray<GHStep *> * steps;
|
20
|
-
|
21
|
-
- (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray *)theSteps;
|
22
|
-
|
23
|
-
@end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
#import "GHScenarioDefinition.h"
|
2
|
-
|
3
|
-
#import "GHScenarioDefinition_Private.h"
|
4
|
-
|
5
|
-
#import "GHTag.h"
|
6
|
-
#import "GHStep.h"
|
7
|
-
|
8
|
-
@interface GHScenarioDefinition ()
|
9
|
-
|
10
|
-
@property (nonatomic, strong) NSArray<GHTag *> * tags;
|
11
|
-
@property (nonatomic, strong) GHLocation * location;
|
12
|
-
@property (nonatomic, strong) NSString * keyword;
|
13
|
-
@property (nonatomic, strong) NSString * name;
|
14
|
-
@property (nonatomic, strong) NSString * desc;
|
15
|
-
@property (nonatomic, strong) NSArray<GHStep *> * steps;
|
16
|
-
|
17
|
-
@end
|
18
|
-
|
19
|
-
@implementation GHScenarioDefinition
|
20
|
-
|
21
|
-
@synthesize location;
|
22
|
-
@synthesize keyword;
|
23
|
-
@synthesize name;
|
24
|
-
@synthesize desc;
|
25
|
-
@synthesize steps;
|
26
|
-
|
27
|
-
- (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps
|
28
|
-
{
|
29
|
-
if (self = [super init])
|
30
|
-
{
|
31
|
-
location = theLocation;
|
32
|
-
keyword = theKeyword;
|
33
|
-
name = theName;
|
34
|
-
desc = theDescription;
|
35
|
-
steps = theSteps;
|
36
|
-
}
|
37
|
-
|
38
|
-
return self;
|
39
|
-
}
|
40
|
-
|
41
|
-
@end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@interface GHScenarioDefinition (Private)
|
3
|
-
|
4
|
-
- (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps;
|
5
|
-
|
6
|
-
@end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHScenarioDefinition.h"
|
3
|
-
|
4
|
-
@class GHExamples;
|
5
|
-
|
6
|
-
@interface GHScenarioOutline : GHScenarioDefinition
|
7
|
-
|
8
|
-
@property (nonatomic, readonly) NSArray<GHExamples *> * examples;
|
9
|
-
|
10
|
-
@property (nonatomic, readonly) NSArray<GHTag *> * tags;
|
11
|
-
|
12
|
-
|
13
|
-
- (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps examples:(NSArray<GHExamples *> *)theExamples;
|
14
|
-
|
15
|
-
@end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#import "GHScenarioOutline.h"
|
2
|
-
|
3
|
-
#import "GHScenarioDefinition_Private.h"
|
4
|
-
|
5
|
-
@interface GHScenarioOutline ()
|
6
|
-
|
7
|
-
@property (nonatomic, strong) NSArray<GHExamples *> * examples;
|
8
|
-
|
9
|
-
@end
|
10
|
-
|
11
|
-
@implementation GHScenarioOutline
|
12
|
-
|
13
|
-
@synthesize examples;
|
14
|
-
@synthesize tags;
|
15
|
-
|
16
|
-
- (id)initWithTags:(NSArray<GHTag *> *)theTags location:(GHLocation *)theLocation keyword:(NSString *)theKeyword name:(NSString *)theName description:(NSString *)theDescription steps:(NSArray<GHStep *> *)theSteps examples:(NSArray<GHExamples *> *)theExamples
|
17
|
-
{
|
18
|
-
if (self = [super initWithLocation: theLocation keyword: theKeyword name: theName description: theDescription steps: theSteps])
|
19
|
-
{
|
20
|
-
examples = theExamples;
|
21
|
-
tags = theTags;
|
22
|
-
}
|
23
|
-
return self;
|
24
|
-
}
|
25
|
-
|
26
|
-
@end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHHasLocationProtocol.h"
|
3
|
-
|
4
|
-
@class GHLocation;
|
5
|
-
@class GHStepArgument;
|
6
|
-
|
7
|
-
@interface GHStep : NSObject <GHHasLocationProtocol>
|
8
|
-
|
9
|
-
@property (nonatomic, readonly) GHLocation * location;
|
10
|
-
@property (nonatomic, readonly) NSString * keyword;
|
11
|
-
@property (nonatomic, readonly) NSString * text;
|
12
|
-
@property (nonatomic, readonly) GHStepArgument * argument;
|
13
|
-
|
14
|
-
- (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword text:(NSString *)theText stepArgument:(GHStepArgument *)theStepArgument;
|
15
|
-
|
16
|
-
@end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
#import "GHStep.h"
|
2
|
-
|
3
|
-
#import "GHLocation.h"
|
4
|
-
#import "GHStepArgument.h"
|
5
|
-
|
6
|
-
@interface GHStep ()
|
7
|
-
|
8
|
-
@property (nonatomic, strong) GHLocation * location;
|
9
|
-
@property (nonatomic, strong) NSString * keyword;
|
10
|
-
@property (nonatomic, strong) NSString * text;
|
11
|
-
@property (nonatomic, strong) GHStepArgument * argument;
|
12
|
-
|
13
|
-
@end
|
14
|
-
|
15
|
-
@implementation GHStep
|
16
|
-
|
17
|
-
@synthesize location;
|
18
|
-
@synthesize keyword;
|
19
|
-
@synthesize text;
|
20
|
-
@synthesize argument;
|
21
|
-
|
22
|
-
- (id)initWithLocation:(GHLocation *)theLocation keyword:(NSString *)theKeyword text:(NSString *)theText stepArgument:(GHStepArgument *)theArgument
|
23
|
-
{
|
24
|
-
if (self = [super init])
|
25
|
-
{
|
26
|
-
location = theLocation;
|
27
|
-
keyword = theKeyword;
|
28
|
-
text = theText;
|
29
|
-
argument = theArgument;
|
30
|
-
}
|
31
|
-
|
32
|
-
return self;
|
33
|
-
}
|
34
|
-
|
35
|
-
@end
|