Adds cocoapods for libraries.
Adds OCMockito and OCHamcrest libs.
This commit is contained in:
45
iOS/Pods/OCHamcrest/Source/Library/Collection/HCIsIn.m
generated
Normal file
45
iOS/Pods/OCHamcrest/Source/Library/Collection/HCIsIn.m
generated
Normal file
@@ -0,0 +1,45 @@
|
||||
// OCHamcrest by Jon Reid, https://qualitycoding.org/
|
||||
// Copyright 2019 hamcrest.org. See LICENSE.txt
|
||||
|
||||
#import "HCIsIn.h"
|
||||
|
||||
|
||||
@interface HCIsIn ()
|
||||
@property (nonatomic, strong, readonly) id collection;
|
||||
@end
|
||||
|
||||
@implementation HCIsIn
|
||||
|
||||
- (instancetype)initWithCollection:(id)collection
|
||||
{
|
||||
if (![collection respondsToSelector:@selector(containsObject:)])
|
||||
{
|
||||
@throw [NSException exceptionWithName:@"NotAContainer"
|
||||
reason:@"Object must respond to -containsObject:"
|
||||
userInfo:nil];
|
||||
}
|
||||
|
||||
self = [super init];
|
||||
if (self)
|
||||
_collection = collection;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)matches:(nullable id)item
|
||||
{
|
||||
return [self.collection containsObject:item];
|
||||
}
|
||||
|
||||
- (void)describeTo:(id <HCDescription>)description
|
||||
{
|
||||
[[description appendText:@"one of "]
|
||||
appendList:self.collection start:@"{" separator:@", " end:@"}"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
id HC_isIn(id aCollection)
|
||||
{
|
||||
return [[HCIsIn alloc] initWithCollection:aCollection];
|
||||
}
|
||||
Reference in New Issue
Block a user