Sha256: 1929cb688720ac46023cc92777e2a67ce1b0cc1076575b96f23202e86689dd91

Contents?: true

Size: 950 Bytes

Versions: 8

Compression:

Stored size: 950 Bytes

Contents

#import "EXPMatchers+beInstanceOf.h"

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

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

  match(^BOOL{
    return [actual isMemberOfClass: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: an instance of %@, got: an instance of %@", [expected class], [actual 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 an instance of %@, got: an instance of %@", [expected class], [actual 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+beInstanceOf.m
second_curtain-0.5.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m
second_curtain-0.4.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m
second_curtain-0.3.0 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m
cocoapods-deintegrate-0.2.1 spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m
cocoapods-deintegrate-0.2.0 spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m
second_curtain-0.2.4 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m
second_curtain-0.2.3 Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m