main
1//
2// Licensed under the terms in License.txt
3//
4// Copyright 2010 Allen Ding. All rights reserved.
5//
6
7#import "NSObject+KiwiSpyAdditions.h"
8
9#import "KWCaptureSpy.h"
10#import "KWMessagePattern.h"
11#import "NSObject+KiwiStubAdditions.h"
12
13@implementation NSObject (KiwiSpyAdditions)
14
15- (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index {
16 KWCaptureSpy *spy = [[[KWCaptureSpy alloc] initWithArgumentIndex:index] autorelease];
17 KWMessagePattern *pattern = [[[KWMessagePattern alloc] initWithSelector:selector] autorelease];
18 [self addMessageSpy:spy forMessagePattern:pattern];
19 return spy;
20}
21
22+ (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index {
23 KWCaptureSpy *spy = [[[KWCaptureSpy alloc] initWithArgumentIndex:index] autorelease];
24 KWMessagePattern *pattern = [[[KWMessagePattern alloc] initWithSelector:selector] autorelease];
25 [self addMessageSpy:spy forMessagePattern:pattern];
26 return spy;
27}
28
29@end