Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trimmurrti committed Feb 28, 2020
1 parent b00ad81 commit ef3eadd
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Quick/Nimble"
github "specta/expecta"
github "specta/expecta" "master"
21 changes: 14 additions & 7 deletions Classes/Core/KWBlockInvocation.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ + (NSInvocation *)invocationWithTarget:(id)anObject messageArguments:(const void
va_list argumentList;
va_start(argumentList, firstBytes);

return [self invocationWithTarget:anObject selector:NULL firstArgument:firstBytes argumentList:argumentList];
return [self invocationWithTarget:anObject
selector:@selector(_doNothing)
firstArgument:firstBytes
argumentList:argumentList];
}

+ (NSInvocation *)invocationWithTarget:(id)anObject
firstArgument:(const void *)firstBytes
argumentList:(va_list)argumentList
{
return [self invocationWithTarget:anObject selector:NULL firstArgument:firstBytes argumentList:argumentList];
return [self invocationWithTarget:anObject
selector:@selector(_doNothing)
firstArgument:firstBytes
argumentList:argumentList];
}

+ (NSInvocation *)invocationWithTarget:(id)anObject
Expand All @@ -43,9 +49,10 @@ + (NSInvocation *)invocationWithTarget:(id)anObject
[NSException raise:NSInvalidArgumentException format:@"%@ - target must be KWProxyBlock", anObject];
}

aSelector = NULL;

return [super invocationWithTarget:anObject selector:aSelector firstArgument:firstBytes argumentList:argumentList];
return [super invocationWithTarget:anObject
selector:@selector(_doNothing)
firstArgument:firstBytes
argumentList:argumentList];
}

#pragma mark - Argument Offset
Expand All @@ -56,8 +63,8 @@ - (NSUInteger)argumentOffset {

#pragma mark - Properties

- (SEL)selector {
return NULL;
- (void)_doNothing {

}

@end
18 changes: 18 additions & 0 deletions Kiwi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@
D7E699792409851900C3D93C /* KWSelectorMessagePattern.h in Headers */ = {isa = PBXBuildFile; fileRef = D7E699622409851900C3D93C /* KWSelectorMessagePattern.h */; settings = {ATTRIBUTES = (Public, ); }; };
D7E6997A2409851900C3D93C /* KWSelectorMessagePattern.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E699632409851900C3D93C /* KWSelectorMessagePattern.m */; };
D7E6997B2409851900C3D93C /* KWSelectorMessagePattern.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E699632409851900C3D93C /* KWSelectorMessagePattern.m */; };
D7E699852409938100C3D93C /* KWBlockMessagePatternTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E6997F2409936E00C3D93C /* KWBlockMessagePatternTest.m */; };
D7E699862409938200C3D93C /* KWBlockMessagePatternTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E6997F2409936E00C3D93C /* KWBlockMessagePatternTest.m */; };
D7E699872409938500C3D93C /* KWProxyBlockTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E699802409936E00C3D93C /* KWProxyBlockTest.m */; };
D7E699882409938600C3D93C /* KWProxyBlockTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E699802409936E00C3D93C /* KWProxyBlockTest.m */; };
D7E699892409938E00C3D93C /* KWBeEvaluatedMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E6997C2409934A00C3D93C /* KWBeEvaluatedMatcherTest.m */; };
D7E6998A2409938F00C3D93C /* KWBeEvaluatedMatcherTest.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E6997C2409934A00C3D93C /* KWBeEvaluatedMatcherTest.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -867,6 +873,9 @@
D7E699612409851900C3D93C /* KWProxyBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWProxyBlock.m; sourceTree = "<group>"; };
D7E699622409851900C3D93C /* KWSelectorMessagePattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWSelectorMessagePattern.h; sourceTree = "<group>"; };
D7E699632409851900C3D93C /* KWSelectorMessagePattern.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWSelectorMessagePattern.m; sourceTree = "<group>"; };
D7E6997C2409934A00C3D93C /* KWBeEvaluatedMatcherTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWBeEvaluatedMatcherTest.m; sourceTree = "<group>"; };
D7E6997F2409936E00C3D93C /* KWBlockMessagePatternTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWBlockMessagePatternTest.m; sourceTree = "<group>"; };
D7E699802409936E00C3D93C /* KWProxyBlockTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWProxyBlockTest.m; sourceTree = "<group>"; };
DA084D3F17E3804200592D5A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
DA084D4217E3804200592D5A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
DA3EAD0718A7A1D700EBBF57 /* KWSharedExampleFunctionalTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWSharedExampleFunctionalTest.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1378,6 +1387,8 @@
F5A1E612117432AC002223E1 /* Support */ = {
isa = PBXGroup;
children = (
D7E6997F2409936E00C3D93C /* KWBlockMessagePatternTest.m */,
D7E699802409936E00C3D93C /* KWProxyBlockTest.m */,
4AD7A2091962AC8F005ED93F /* Config.m */,
F5D7C8D311643C2900758FEA /* KWDeviceInfoTest.m */,
89861D9316FE0EE5008CE99D /* KWFormatterTest.m */,
Expand All @@ -1394,6 +1405,7 @@
F5A9EFD211741E7700E9EDA3 /* Matchers */ = {
isa = PBXGroup;
children = (
D7E6997C2409934A00C3D93C /* KWBeEvaluatedMatcherTest.m */,
F553B2D211756157004FCA2E /* KWBeBetweenMatcherTest.m */,
F553B4411175A190004FCA2E /* KWBeEmptyMatcherTest.m */,
F5E50320119EA22F00F5D05F /* KWBeIndenticalToMatcherTest.m */,
Expand Down Expand Up @@ -1942,6 +1954,7 @@
4AE030951AEB494400556381 /* KWBeTrueMatcherTest.m in Sources */,
4AE030961AEB494400556381 /* KWBeWithinMatcherTest.m in Sources */,
4AE030971AEB494400556381 /* KWBlockRaiseMatcherTest.m in Sources */,
D7E699862409938200C3D93C /* KWBlockMessagePatternTest.m in Sources */,
4B9314A623D0E83C007A295C /* KWNotificationMatcherTest.m in Sources */,
4AE030981AEB494400556381 /* KWChangeMatcherTest.m in Sources */,
4AE030991AEB494400556381 /* KWConformToProtocolMatcherTest.m in Sources */,
Expand All @@ -1952,9 +1965,11 @@
4AE0309D1AEB494400556381 /* KWGenericMatcherTest.m in Sources */,
4AE0309E1AEB494400556381 /* KWHaveMatcherTest.m in Sources */,
CE7EFF9A1B8475BD00FFE6D6 /* KWSwiftXCTestAssertionTests.swift in Sources */,
D7E699882409938600C3D93C /* KWProxyBlockTest.m in Sources */,
4AE0309F1AEB494400556381 /* KWHaveValueMatcherTest.m in Sources */,
4AE030A01AEB494400556381 /* KWInequalityMatcherTest.m in Sources */,
4AE030A11AEB494400556381 /* KWReceiveMatcherTest.m in Sources */,
D7E6998A2409938F00C3D93C /* KWBeEvaluatedMatcherTest.m in Sources */,
4AE030A21AEB494400556381 /* KWRegularExpressionPatternMatcherTest.m in Sources */,
4AE030A31AEB494400556381 /* KWRespondToSelectorMatcherTest.m in Sources */,
4AE030A41AEB494400556381 /* KWUserDefinedMatcherTest.m in Sources */,
Expand Down Expand Up @@ -2117,6 +2132,7 @@
CE87C4FB1AF1994100310C07 /* KWBeWithinMatcherTest.m in Sources */,
CE87C4FC1AF1994100310C07 /* KWBlockRaiseMatcherTest.m in Sources */,
CE87C4FD1AF1994100310C07 /* KWChangeMatcherTest.m in Sources */,
D7E699852409938100C3D93C /* KWBlockMessagePatternTest.m in Sources */,
4B9314A523D0E83C007A295C /* KWNotificationMatcherTest.m in Sources */,
CE87C4FE1AF1994100310C07 /* KWConformToProtocolMatcherTest.m in Sources */,
CE87C4FF1AF1994100310C07 /* KWContainMatcherTest.m in Sources */,
Expand All @@ -2127,9 +2143,11 @@
CE87C5031AF1994100310C07 /* KWHaveMatcherTest.m in Sources */,
CE87C5041AF1994100310C07 /* KWHaveValueMatcherTest.m in Sources */,
CE7EFF991B8475BD00FFE6D6 /* KWSwiftXCTestAssertionTests.swift in Sources */,
D7E699872409938500C3D93C /* KWProxyBlockTest.m in Sources */,
CE87C5051AF1994100310C07 /* KWInequalityMatcherTest.m in Sources */,
CE87C5061AF1994100310C07 /* KWReceiveMatcherTest.m in Sources */,
CE87C5071AF1994100310C07 /* KWRegularExpressionPatternMatcherTest.m in Sources */,
D7E699892409938E00C3D93C /* KWBeEvaluatedMatcherTest.m in Sources */,
CE87C5081AF1994100310C07 /* KWRespondToSelectorMatcherTest.m in Sources */,
CE87C5091AF1994100310C07 /* KWUserDefinedMatcherTest.m in Sources */,
CE87C50A1AF1994100310C07 /* KWBeZeroMatcherTest.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion Tests/KWMessagePatternFunctionalTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#import "KiwiTestConfiguration.h"
#import "TestClasses.h"

typedef void(^KWVoidTestBlock)();
typedef void(^KWVoidTestBlock)(void);
typedef void(^KWArgumentTestBlock)(id);
typedef void(^KWMultiArgumentTestBlock)(id, id, id);

Expand Down
10 changes: 5 additions & 5 deletions Tests/KWProxyBlockTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void)tearDown {
#pragma mark - Test block without parameters

- (void)testItShouldEvaluateWrappedVoidBlock {
__KWVoidBlock block = ^{ _evaluated = YES; };
__KWVoidBlock block = ^{ self->_evaluated = YES; };

KWProxyBlock *wrappedBlock = [KWProxyBlock blockWithBlock:block];

Expand All @@ -84,7 +84,7 @@ - (void)testItShouldEvaluateWrappedVoidBlock {

- (void)testItShouldEvaluateWrappedPrimitiveBlock {
__KWPrimitiveBlock block = ^{
_evaluated = YES;
self->_evaluated = YES;

return KWUIntValue;
};
Expand All @@ -96,7 +96,7 @@ - (void)testItShouldEvaluateWrappedPrimitiveBlock {

- (void)testItShouldEvaluateWrappedObjectBlock {
__KWObjectBlock block = ^{
_evaluated = YES;
self->_evaluated = YES;

return KWStringValue;
};
Expand All @@ -108,7 +108,7 @@ - (void)testItShouldEvaluateWrappedObjectBlock {

- (void)testItShouldEvaluateWrappedStretBlock {
__KWStretBlock block = ^{
_evaluated = YES;
self->_evaluated = YES;

return KWStructValue;
};
Expand Down Expand Up @@ -170,4 +170,4 @@ - (void)assertCorrectParamsWithUInteger:(NSUInteger)intValue object:(id)object s

@end

#endif
#endif

0 comments on commit ef3eadd

Please sign in to comment.