Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for class type check.

  • Loading branch information...
commit e214a916934915325da8a54d02032fc1abeceb4e 1 parent 532ebb7
@modocache modocache authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 Tests/KWMessagePatternTest.m
View
11 Tests/KWMessagePatternTest.m
@@ -64,6 +64,17 @@ - (void)testItShouldMatchInvocationsWithAnyArguments {
STAssertTrue([messagePattern matchesInvocation:invocation], @"expected matching invocation");
}
+- (void)testItShouldMatchInvocationsWithClassArgument {
+ KWMessagePattern *messagePattern = [self messagePatternWithSelector:@selector(isKindOfClass:)
+ arguments:[NSObject class], nil];
+ NSMethodSignature *signature = [NSObject instanceMethodSignatureForSelector:@selector(isKindOfClass:)];
+ NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
+ [invocation setSelector:@selector(isKindOfClass:)];
+ Class objectClass = [NSObject class];
+ [invocation setMessageArguments:&objectClass];
+ STAssertTrue([messagePattern matchesInvocation:invocation], @"expected matching invocation");
+}
+
- (void)testItShouldMatchInvocationsWithAnyArgumentsWhenCreatedWithMessagePatternFromInvocation {
NSMethodSignature *signature = [NSObject instanceMethodSignatureForSelector:@selector(addObserver:forKeyPath:options:context:)];
NSInvocation *creationInvocation = [NSInvocation invocationWithMethodSignature:signature];
Please sign in to comment.
Something went wrong with that request. Please try again.