Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated OCMock framework and added a unit test
- Loading branch information
Showing
18 changed files
with
503 additions
and
78 deletions.
There are no files selected for viewing
23 changes: 17 additions & 6 deletions
23
Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
//--------------------------------------------------------------------------------------- | ||
// $Id: NSNotificationCenter+OCMAdditions.h$ | ||
// Copyright (c) 2009 by Mulle Kybernetik. See License file for details. | ||
//--------------------------------------------------------------------------------------- | ||
/* | ||
* Copyright (c) 2009-2014 Erik Doernenburg and contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use these files except in compliance with the License. You may obtain | ||
* a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class OCMockObserver; | ||
@class OCObserverMockObject; | ||
|
||
|
||
@interface NSNotificationCenter(OCMAdditions) | ||
|
||
- (void)addMockObserver:(OCMockObserver *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; | ||
- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2014 Erik Doernenburg and contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use these files except in compliance with the License. You may obtain | ||
* a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface OCMLocation : NSObject | ||
{ | ||
id testCase; | ||
NSString *file; | ||
NSUInteger line; | ||
} | ||
|
||
+ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; | ||
|
||
- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; | ||
|
||
- (id)testCase; | ||
- (NSString *)file; | ||
- (NSUInteger)line; | ||
|
||
@end | ||
|
||
extern OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); |
45 changes: 45 additions & 0 deletions
45
Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (c) 2014 Erik Doernenburg and contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use these files except in compliance with the License. You may obtain | ||
* a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class OCMLocation; | ||
@class OCMRecorder; | ||
@class OCMStubRecorder; | ||
@class OCMockObject; | ||
|
||
|
||
@interface OCMMacroState : NSObject | ||
{ | ||
OCMRecorder *recorder; | ||
} | ||
|
||
+ (void)beginStubMacro; | ||
+ (OCMStubRecorder *)endStubMacro; | ||
|
||
+ (void)beginExpectMacro; | ||
+ (OCMStubRecorder *)endExpectMacro; | ||
|
||
+ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; | ||
+ (void)endVerifyMacro; | ||
|
||
+ (OCMMacroState *)globalState; | ||
|
||
- (OCMRecorder *)recorder; | ||
|
||
- (void)switchToClassMethod; | ||
|
||
@end |
39 changes: 39 additions & 0 deletions
39
Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2014 Erik Doernenburg and contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use these files except in compliance with the License. You may obtain | ||
* a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class OCMockObject; | ||
@class OCMInvocationMatcher; | ||
|
||
|
||
@interface OCMRecorder : NSProxy | ||
{ | ||
OCMockObject *mockObject; | ||
OCMInvocationMatcher *invocationMatcher; | ||
} | ||
|
||
- (instancetype)init; | ||
- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; | ||
|
||
- (void)setMockObject:(OCMockObject *)aMockObject; | ||
|
||
- (OCMInvocationMatcher *)invocationMatcher; | ||
|
||
- (id)classMethod; | ||
- (id)ignoringNonObjectArgs; | ||
|
||
@end |
56 changes: 56 additions & 0 deletions
56
Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2004-2014 Erik Doernenburg and contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use these files except in compliance with the License. You may obtain | ||
* a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#import "OCMRecorder.h" | ||
|
||
|
||
@interface OCMStubRecorder : OCMRecorder | ||
|
||
- (id)andReturn:(id)anObject; | ||
- (id)andReturnValue:(NSValue *)aValue; | ||
- (id)andThrow:(NSException *)anException; | ||
- (id)andPost:(NSNotification *)aNotification; | ||
- (id)andCall:(SEL)selector onObject:(id)anObject; | ||
- (id)andDo:(void (^)(NSInvocation *invocation))block; | ||
- (id)andForwardToRealObject; | ||
|
||
@end | ||
|
||
|
||
@interface OCMStubRecorder (Properties) | ||
|
||
#define andReturn(aValue) _andReturn(({ __typeof__(aValue) _v = (aValue); [NSValue value:&_v withObjCType:@encode(__typeof__(_v))]; })) | ||
@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); | ||
|
||
#define andThrow(anException) _andThrow(anException) | ||
@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); | ||
|
||
#define andPost(aNotification) _andPost(aNotification) | ||
@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); | ||
|
||
#define andCall(anObject, aSelector) _andCall(anObject, aSelector) | ||
@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); | ||
|
||
#define andDo(aBlock) _andDo(aBlock) | ||
@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); | ||
|
||
#define andForwardToRealObject() _andForwardToRealObject() | ||
@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); | ||
|
||
@end | ||
|
||
|
||
|
Oops, something went wrong.