Adds cocoapods for libraries.

Adds OCMockito and OCHamcrest libs.
This commit is contained in:
2020-09-05 22:06:51 -07:00
parent af47156557
commit c3031fbc39
364 changed files with 17147 additions and 1 deletions

View File

@@ -0,0 +1,56 @@
// OCHamcrest by Jon Reid, https://qualitycoding.org/
// Copyright 2019 hamcrest.org. See LICENSE.txt
#import "HCIsDictionaryContaining.h"
#import "HCRequireNonNilObject.h"
#import "HCWrapInMatcher.h"
@interface HCIsDictionaryContaining ()
@property (nonatomic, strong, readonly) id <HCMatcher> keyMatcher;
@property (nonatomic, strong, readonly) id <HCMatcher> valueMatcher;
@end
@implementation HCIsDictionaryContaining
- (instancetype)initWithKeyMatcher:(id <HCMatcher>)keyMatcher
valueMatcher:(id <HCMatcher>)valueMatcher
{
self = [super init];
if (self)
{
_keyMatcher = keyMatcher;
_valueMatcher = valueMatcher;
}
return self;
}
- (BOOL)matches:(id)dict
{
if ([dict isKindOfClass:[NSDictionary class]])
for (id oneKey in dict)
if ([self.keyMatcher matches:oneKey] && [self.valueMatcher matches:dict[oneKey]])
return YES;
return NO;
}
- (void)describeTo:(id <HCDescription>)description
{
[[[[[description appendText:@"a dictionary containing { "]
appendDescriptionOf:self.keyMatcher]
appendText:@" = "]
appendDescriptionOf:self.valueMatcher]
appendText:@"; }"];
}
@end
id HC_hasEntry(id keyMatcher, id valueMatcher)
{
HCRequireNonNilObject(keyMatcher);
HCRequireNonNilObject(valueMatcher);
return [[HCIsDictionaryContaining alloc] initWithKeyMatcher:HCWrapInMatcher(keyMatcher)
valueMatcher:HCWrapInMatcher(valueMatcher)];
}