Sha256: 665763f3fc02d8f8f40c4964f1afa78fad73b5a3175c6a6a0bb3d4f10066eed4

Contents?: true

Size: 1016 Bytes

Versions: 8

Compression:

Stored size: 1016 Bytes

Contents

#import "EXPMatchers+beKindOf.h"

EXPMatcherImplementationBegin(beKindOf, (Class expected)) {
  BOOL actualIsNil = (actual == nil);
  BOOL expectedIsNil = (expected == nil);

  prerequisite(^BOOL{
    return !(actualIsNil || expectedIsNil);
  });

  match(^BOOL{
    return [actual isKindOfClass:expected];
  });

  failureMessageForTo(^NSString *{
    if(actualIsNil) return @"the actual value is nil/null";
    if(expectedIsNil) return @"the expected value is nil/null";
    return [NSString stringWithFormat:@"expected: a kind of %@, got: an instance of %@, which is not a kind of %@", [expected class], [actual class], [expected class]];
  });

  failureMessageForNotTo(^NSString *{
    if(actualIsNil) return @"the actual value is nil/null";
    if(expectedIsNil) return @"the expected value is nil/null";
    return [NSString stringWithFormat:@"expected: not a kind of %@, got: an instance of %@, which is a kind of %@", [expected class], [actual class], [expected class]];
  });
}
EXPMatcherImplementationEnd

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
second_curtain-0.6.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
second_curtain-0.5.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
second_curtain-0.4.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
second_curtain-0.3.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
cocoapods-deintegrate-0.2.1 spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
cocoapods-deintegrate-0.2.0 spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
second_curtain-0.2.4 Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m
second_curtain-0.2.3 Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m