main
 1//
 2// Licensed under the terms in License.txt
 3//
 4// Copyright 2010 Allen Ding. All rights reserved.
 5//
 6
 7#import "KiwiConfiguration.h"
 8
 9@class KWMessagePattern;
10
11@protocol KWMessageSpying;
12
13@interface NSObject(KiwiStubAdditions)
14
15#pragma mark -
16#pragma mark Stubbing Methods
17
18- (void)stub:(SEL)aSelector;
19- (void)stub:(SEL)aSelector withBlock:(id (^)(NSArray *params))block;
20- (void)stub:(SEL)aSelector withArguments:(id)firstArgument, ...;
21- (void)stub:(SEL)aSelector andReturn:(id)aValue;
22- (void)stub:(SEL)aSelector andReturn:(id)aValue withArguments:(id)firstArgument, ...;
23
24+ (void)stub:(SEL)aSelector;
25+ (void)stub:(SEL)aSelector withBlock:(id (^)(NSArray *params))block;
26+ (void)stub:(SEL)aSelector withArguments:(id)firstArgument, ...;
27+ (void)stub:(SEL)aSelector andReturn:(id)aValue;
28+ (void)stub:(SEL)aSelector andReturn:(id)aValue withArguments:(id)firstArgument, ...;
29
30- (id)stub;
31- (id)stubAndReturn:(id)aValue;
32- (id)stubAndReturn:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
33
34- (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue;
35- (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue overrideExisting:(BOOL)overrideExisting;
36- (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
37- (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern withBlock:(id (^)(NSArray *params))block;
38
39+ (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue;
40+ (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern andReturn:(id)aValue times:(id)times afterThatReturn:(id)aSecondValue;
41+ (void)stubMessagePattern:(KWMessagePattern *)aMessagePattern withBlock:(id (^)(NSArray *params))block;
42
43- (void)clearStubs;
44
45#pragma mark -
46#pragma mark Spying on Messages
47
48- (void)addMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
49- (void)removeMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
50
51+ (void)addMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
52+ (void)removeMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
53
54@end