-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jasper Blues
committed
Feb 10, 2013
1 parent
12286da
commit 67d86d0
Showing
28 changed files
with
1,119 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
// | ||
// OCMockito - MKTBaseMockObject.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Jon Reid, http://qualitycoding.org/ | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "MKTPrimitiveArgumentMatching.h" | ||
|
||
|
||
@interface MKTBaseMockObject : NSProxy <MKTPrimitiveArgumentMatching> | ||
|
||
- (id)init; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// OCMockito - MKTClassObjectMock.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Jon Reid, http://qualitycoding.org/ | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
// Created by: David Hart | ||
// | ||
|
||
#import "MKTBaseMockObject.h" | ||
|
||
|
||
/** | ||
Mock object of a given class object. | ||
*/ | ||
@interface MKTClassObjectMock : MKTBaseMockObject | ||
|
||
+ (id)mockForClass:(Class)aClass; | ||
- (id)initWithClass:(Class)aClass; | ||
|
||
@end |
20 changes: 20 additions & 0 deletions
20
External/OCMockito.framework/Headers/MKTObjectAndProtocolMock.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,20 @@ | ||
// | ||
// OCMockito - MKTObjectAndProtocolMock.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Kevin Lundberg | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
|
||
#import "MKTProtocolMock.h" | ||
|
||
|
||
/** | ||
Mock object of a given class that also implements a given protocol. | ||
*/ | ||
@interface MKTObjectAndProtocolMock : MKTProtocolMock | ||
|
||
+ (id)mockForClass:(Class)aClass protocol:(Protocol *)protocol; | ||
- (id)initWithClass:(Class)aClass protocol:(Protocol *)protocol; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// OCMockito - MKTObjectMock.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Jon Reid, http://qualitycoding.org/ | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
|
||
#import "MKTBaseMockObject.h" | ||
|
||
|
||
/** | ||
Mock object of a given class. | ||
*/ | ||
@interface MKTObjectMock : MKTBaseMockObject | ||
|
||
+ (id)mockForClass:(Class)aClass; | ||
- (id)initWithClass:(Class)aClass; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// OCMockito - MKTOngoingStubbing.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Jon Reid, http://qualitycoding.org/ | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "MKTPrimitiveArgumentMatching.h" | ||
|
||
@class MKTInvocationContainer; | ||
|
||
|
||
/** | ||
Methods to invoke on @c given(methodCall) to return stubbed values. | ||
*/ | ||
@interface MKTOngoingStubbing : NSObject <MKTPrimitiveArgumentMatching> | ||
|
||
- (id)initWithInvocationContainer:(MKTInvocationContainer *)invocationContainer; | ||
|
||
/// Stubs given object as return value. | ||
- (MKTOngoingStubbing *)willReturn:(id)object; | ||
|
||
/// Stubs given @c BOOL as return value. | ||
- (MKTOngoingStubbing *)willReturnBool:(BOOL)value; | ||
|
||
/// Stubs given @c char as return value. | ||
- (MKTOngoingStubbing *)willReturnChar:(char)value; | ||
|
||
/// Stubs given @c int as return value. | ||
- (MKTOngoingStubbing *)willReturnInt:(int)value; | ||
|
||
/// Stubs given @c short as return value. | ||
- (MKTOngoingStubbing *)willReturnShort:(short)value; | ||
|
||
/// Stubs given @c long as return value. | ||
- (MKTOngoingStubbing *)willReturnLong:(long)value; | ||
|
||
/// Stubs given <code>long long</code> as return value. | ||
- (MKTOngoingStubbing *)willReturnLongLong:(long long)value; | ||
|
||
/// Stubs given @c NSInteger as return value. | ||
- (MKTOngoingStubbing *)willReturnInteger:(NSInteger)value; | ||
|
||
/// Stubs given <code>unsigned char</code> as return value. | ||
- (MKTOngoingStubbing *)willReturnUnsignedChar:(unsigned char)value; | ||
|
||
/// Stubs given <code>unsigned int</code> as return value. | ||
- (MKTOngoingStubbing *)willReturnUnsignedInt:(unsigned int)value; | ||
|
||
/// Stubs given <code>unsigned short</code> as return value. | ||
- (MKTOngoingStubbing *)willReturnUnsignedShort:(unsigned short)value; | ||
|
||
/// Stubs given <code>unsigned long</code> as return value. | ||
- (MKTOngoingStubbing *)willReturnUnsignedLong:(unsigned long)value; | ||
|
||
/// Stubs given <code>unsigned long long</code> as return value. | ||
- (MKTOngoingStubbing *)willReturnUnsignedLongLong:(unsigned long long)value; | ||
|
||
/// Stubs given @c NSUInteger as return value. | ||
- (MKTOngoingStubbing *)willReturnUnsignedInteger:(NSUInteger)value; | ||
|
||
/// Stubs given @c float as return value. | ||
- (MKTOngoingStubbing *)willReturnFloat:(float)value; | ||
|
||
/// Stubs given @c double as return value. | ||
- (MKTOngoingStubbing *)willReturnDouble:(double)value; | ||
|
||
@end |
50 changes: 50 additions & 0 deletions
50
External/OCMockito.framework/Headers/MKTPrimitiveArgumentMatching.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,50 @@ | ||
// | ||
// OCMockito - MKTPrimitiveArgumentMatching.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Jon Reid, http://qualitycoding.org/ | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
|
||
@protocol HCMatcher; | ||
|
||
|
||
/** | ||
Ability to specify OCHamcrest matchers for primitive numeric arguments. | ||
*/ | ||
@protocol MKTPrimitiveArgumentMatching | ||
|
||
/** | ||
Specifies OCHamcrest matcher for a specific argument of a method. | ||
For methods arguments that take objects, just pass the matcher directly as a method call. But | ||
for arguments that take primitive numeric types, call this to specify the matcher before passing | ||
in a dummy value. Upon verification, the actual numeric argument received will be converted to | ||
an NSNumber before being checked by the matcher. | ||
The argument index is 0-based, so the first argument of a method has index 0. | ||
Example: | ||
@code | ||
[[verify(mockArray) withMatcher:greaterThan([NSNumber numberWithInt:1]) forArgument:0] | ||
removeObjectAtIndex:0]; | ||
@endcode | ||
This verifies that @c removeObjectAtIndex: was called with a number greater than 1. | ||
*/ | ||
- (id)withMatcher:(id <HCMatcher>)matcher forArgument:(NSUInteger)index; | ||
|
||
/** | ||
Specifies OCHamcrest matcher for the first argument of a method. | ||
Equivalent to <code>withMatcher:matcher forArgument:0</code>. | ||
Example: | ||
@code | ||
[[verify(mockArray) withMatcher:greaterThan([NSNumber numberWithInt:1]) forArgument:0] | ||
removeObjectAtIndex:0]; | ||
@endcode | ||
This verifies that @c removeObjectAtIndex: was called with a number greater than 1. | ||
*/ | ||
- (id)withMatcher:(id <HCMatcher>)matcher; | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// OCMockito - MKTProtocolMock.h | ||
// Copyright 2012 Jonathan M. Reid. See LICENSE.txt | ||
// | ||
// Created by: Jon Reid, http://qualitycoding.org/ | ||
// Source: https://github.com/jonreid/OCMockito | ||
// | ||
|
||
#import "MKTBaseMockObject.h" | ||
|
||
|
||
/** | ||
Mock object implementing a given protocol. | ||
*/ | ||
@interface MKTProtocolMock : MKTBaseMockObject | ||
|
||
+ (id)mockForProtocol:(Protocol *)aProtocol; | ||
- (id)initWithProtocol:(Protocol *)aProtocol; | ||
|
||
@end |
Oops, something went wrong.