Files
MonsterCards/iOS/Pods/OCHamcrest/Source/Library/Object/HCClassMatcher.m
Tom Hicks c3031fbc39 Adds cocoapods for libraries.
Adds OCMockito and OCHamcrest libs.
2020-09-05 22:06:51 -07:00

44 lines
986 B
Objective-C

// OCHamcrest by Jon Reid, https://qualitycoding.org/
// Copyright 2019 hamcrest.org. See LICENSE.txt
#import "HCClassMatcher.h"
#import "HCRequireNonNilObject.h"
@interface HCClassMatcher (SubclassResponsibility)
- (NSString *)expectation;
@end
@implementation HCClassMatcher
- (instancetype)initWithClass:(Class)aClass
{
HCRequireNonNilObject(aClass);
self = [super init];
if (self)
_theClass = aClass;
return self;
}
- (void)describeTo:(id <HCDescription>)description
{
[[description appendText:[self expectation]]
appendText:NSStringFromClass(self.theClass)];
}
- (void)describeMismatchOf:(nullable id)item to:(nullable id <HCDescription>)mismatchDescription
{
[mismatchDescription appendText:@"was "];
if (item)
{
[[mismatchDescription appendText:NSStringFromClass([item class])]
appendText:@" instance "];
}
[mismatchDescription appendDescriptionOf:item];
}
@end