Skip to content

Commit

Permalink
Merge pull request #718 from mugx-fc/master
Browse files Browse the repository at this point in the history
Removes duplicate of captureArgument
  • Loading branch information
ecaselles authored Jan 31, 2020
2 parents 5496851 + 3764102 commit c5e5c2b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Classes/Stubbing/NSObject+KiwiStubAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@

- (void)addMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
- (void)removeMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
- (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index;

+ (void)addMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
+ (void)removeMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern;
+ (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index;

@end

Expand Down
12 changes: 0 additions & 12 deletions Classes/Stubbing/NSObject+KiwiStubAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,6 @@ - (void)removeMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessageP
KWClearObjectSpy(self, aSpy, aMessagePattern);
}

- (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index {
KWCaptureSpy *spy = [[KWCaptureSpy alloc] initWithArgumentIndex:index];
[self addMessageSpy:spy forMessagePattern:[KWMessagePattern messagePatternWithSelector:selector]];
return spy;
}

+ (void)addMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessagePattern *)aMessagePattern {
if ([self methodSignatureForSelector:aMessagePattern.selector] == nil) {
[NSException raise:@"KWSpyException" format:@"cannot add spy for -%@ because no such method exists",
Expand All @@ -243,10 +237,4 @@ + (void)removeMessageSpy:(id<KWMessageSpying>)aSpy forMessagePattern:(KWMessageP
KWClearObjectSpy(self, aSpy, aMessagePattern);
}

+ (KWCaptureSpy *)captureArgument:(SEL)selector atIndex:(NSUInteger)index {
KWCaptureSpy *spy = [[KWCaptureSpy alloc] initWithArgumentIndex:index];
[self addMessageSpy:spy forMessagePattern:[KWMessagePattern messagePatternWithSelector:selector]];
return spy;
}

@end

0 comments on commit c5e5c2b

Please sign in to comment.