Authored by Jonas Budelmann

update Podfile.lock

Showing 34 changed files with 356 additions and 83 deletions
PODS:
- Expecta (0.2.3)
- Masonry (0.4.0)
- Expecta (0.3.0)
- Masonry (0.5.0)
DEPENDENCIES:
- Expecta
... ... @@ -11,7 +11,7 @@ EXTERNAL SOURCES:
:path: ./
SPEC CHECKSUMS:
Expecta: 2434bb2e2b3b1814280ec5d9a11359433d035975
Masonry: d673617c9cbc24aaea90fba20b10e47fd9970a39
Expecta: 322f1dc42610106a5ba9871b4924cf1635d80833
Masonry: bef482b29f00b33a2da916e1011af85f5d371d66
COCOAPODS: 0.32.1
... ...
../../Expecta/src/matchers/EXPMatchers+beSupersetOf.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+beginWith.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+endWith.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+notify.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+respondTo.h
\ No newline at end of file
... ...
# Expecta
#Expecta
A Matcher Framework for Objective-C/Cocoa
## NOTICE
Expecta 0.2.x has a new syntax that is slightly different from Expecta 0.1.x. For example `expect(x).toEqual(y)` should now be written as `expect(x).to.equal(y)`. You can do `#define EXP_OLD_SYNTAX` before importing `Expecta.h` to enable backward-compatiblity mode, but keep in mind that the old syntax is deprecated.
Expecta 0.3.x removes support for Garbage Collected targets, as support for these has been removed from Xcode 5.1 and greater. If you need Garbage Collection support, please continue to use Expecta 0.2.4. The minimum deployment targets have also been raised to iOS 5.x and OS X 10.7 or greater.
Expecta 0.2.x and later has a new syntax that is slightly different from Expecta 0.1.x. For example `expect(x).toEqual(y)` should now be written as `expect(x).to.equal(y)`. You can do `#define EXP_OLD_SYNTAX` before importing `Expecta.h` to enable backward-compatiblity mode, but keep in mind that the old syntax is deprecated.
## INTRODUCTION
... ... @@ -17,14 +19,11 @@ assertThat(@"foo", is(equalTo(@"foo")));
assertThatUnsignedInteger(foo, isNot(equalToUnsignedInteger(1)));
assertThatBool([bar isBar], is(equalToBool(YES)));
assertThatDouble(baz, is(equalToDouble(3.14159)));
```
vs.
``` vs. **Expecta **
**Expecta**
```objective-c
expect(@"foo").to.equal(@"foo"); // `to` is a syntatic sugar and can be safely omitted.
```objective -
c expect(@"foo").to.equal(
@"foo"); // `to` is a syntatic sugar and can be safely omitted.
expect(foo).notTo.equal(1);
expect([bar isBar]).to.equal(YES);
expect(baz).to.equal(3.14159);
... ... @@ -36,12 +35,12 @@ Use [CocoaPods](https://github.com/CocoaPods/CocoaPods)
```ruby
target :MyApp do
# your app dependencies
#your app dependencies
end
target :MyAppTests do
pod 'Expecta', '~> 0.2.3' # expecta matchers
# pod 'Specta', '~> 0.1.11' # specta bdd framework
pod 'Expecta', '~> 0.2.4' # expecta matchers
#pod 'Specta', '~> 0.1.11' #specta bdd framework
end
```
... ... @@ -77,7 +76,9 @@ Expecta is framework-agnostic. It works well with OCUnit (SenTestingKit) and OCU
>
>`expect(x).to.beFalsy();` passes if x evaluates to false (zero).
>
>`expect(x).to.contain(y);` passes if an instance of NSArray, NSDictionary or NSString x contains y.
>`expect(x).to.contain(y);` passes if an instance of NSArray or NSString x contains y.
>
>`expect(x).to.beSupersetOf(y);` passes if an instance of NSArray, NSSet, NSDictionary or NSOrderedSet x contains all elements of y.
>
>`expect(x).to.haveCountOf(y);` passes if an instance of NSArray, NSSet, NSDictionary or NSString x has a count or length of y.
>
... ... @@ -106,6 +107,18 @@ Expecta is framework-agnostic. It works well with OCUnit (SenTestingKit) and OCU
>`expect(^{ /* code */ }).to.raise(@"ExceptionName");` passes if a given block of code raises an exception named `ExceptionName`.
>
>`expect(^{ /* code */ }).to.raiseAny();` passes if a given block of code raises any exception.
>
>`expect(x).to.conformTo(y);` passes if `x` conforms to the protocol `y`.
>
>`expect(x).to.respondTo(y);` passes if `x` responds to the selector `y`.
>
>`expect(^{ /* code */ }).to.notify(@"NotificationName");` passes if a given block of code generates an NSNotification named `NotificationName`.
>
>`expect(^{ /* code */ }).to.notify(notification);` passes if a given block of code generates an NSNotification equal to the passed `notification`.
>
>`expect(x).to.beginWith(y);` passes if an instance of NSString, NSArray, or NSOrderedSet `x` begins with `y`. Also aliased by `startWith`
>
>`expect(x).to.endWith(y);` passes if an instance of NSString, NSArray, or NSOrderedSet `x` ends with `y`.
**Please contribute more matchers.**
... ... @@ -136,7 +149,8 @@ Writing a new matcher is easy with special macros provided by Expecta. Take a lo
EXPMatcherInterface(beKindOf, (Class expected));
// 1st argument is the name of the matcher function
// 2nd argument is the list of arguments that may be passed in the function call.
// 2nd argument is the list of arguments that may be passed in the function
// call.
// Multiple arguments are fine. (e.g. (int foo, float bar))
#define beAKindOf beKindOf
... ... @@ -151,33 +165,40 @@ EXPMatcherImplementationBegin(beKindOf, (Class expected)) {
BOOL actualIsNil = (actual == nil);
BOOL expectedIsNil = (expected == nil);
prerequisite(^BOOL{
prerequisite(^BOOL {
return !(actualIsNil || expectedIsNil);
// Return `NO` if matcher should fail whether or not the result is inverted using `.Not`.
// Return `NO` if matcher should fail whether or not the result is inverted
// using `.Not`.
});
match(^BOOL{
match(^BOOL {
return [actual isKindOfClass:expected];
// Return `YES` if the matcher should pass, `NO` if it should not.
// The actual value/object is passed as `actual`.
// Please note that primitive values will be wrapped in NSNumber/NSValue.
});
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]];
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]];
// Return the message to be displayed when the match function returns `YES`.
});
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]];
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]];
// Return the message to be displayed when the match function returns `NO`.
});
}
... ...
... ... @@ -131,16 +131,13 @@ void EXPFail(id testCase, int lineNumber, const char *fileName, NSString *messag
NSString *EXPDescribeObject(id obj) {
if(obj == nil) {
return @"nil/null";
} else if([obj isKindOfClass:[NSValue class]]) {
if([obj isKindOfClass:[NSValue class]] && ![obj isKindOfClass:[NSNumber class]]) {
void *pointerValue = [obj pointerValue];
const char *type = [(NSValue *)obj _EXP_objCType];
if(type) {
if(strcmp(type, @encode(SEL)) == 0) {
return [NSString stringWithFormat:@"@selector(%@)", NSStringFromSelector([obj pointerValue])];
} else if(strcmp(type, @encode(Class)) == 0) {
return NSStringFromClass(pointerValue);
}
} else if([obj isKindOfClass:[NSValue class]] && ![obj isKindOfClass:[NSNumber class]]) {
const char *type = [(NSValue *)obj _EXP_objCType];
if(type) {
if(strcmp(type, @encode(SEL)) == 0) {
return [NSString stringWithFormat:@"@selector(%@)", NSStringFromSelector([obj pointerValue])];
} else if(strcmp(type, @encode(Class)) == 0) {
return NSStringFromClass([obj pointerValue]);
}
}
}
... ... @@ -164,6 +161,8 @@ NSString *EXPDescribeObject(id obj) {
[arr addObject:[NSString stringWithFormat:@"%@ = %@;",EXPDescribeObject(k), EXPDescribeObject(v)]];
}
description = [NSString stringWithFormat:@"{%@}", [arr componentsJoinedByString:@" "]];
} else if([obj isKindOfClass:[NSAttributedString class]]) {
description = [obj string];
} else {
description = [description stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
}
... ...
#import "Expecta.h"
EXPMatcherInterface(_beIdenticalTo, (void *expected));
EXPMatcherInterface(beIdenticalTo, (void *expected)); // to aid code completion
#if __has_feature(objc_arc)
#define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected)
... ...
#import "Expecta.h"
EXPMatcherInterface(beSupersetOf, (id subset));
... ...
#import "EXPMatchers+contain.h"
EXPMatcherImplementationBegin(beSupersetOf, (id subset)) {
BOOL actualIsCompatible = [actual isKindOfClass:[NSDictionary class]] || [actual respondsToSelector:@selector(containsObject:)];
BOOL subsetIsNil = (subset == nil);
BOOL classMatches = [subset isKindOfClass:[actual class]];
prerequisite(^BOOL{
return actualIsCompatible && !subsetIsNil && classMatches;
});
match(^BOOL{
if(!actualIsCompatible) return NO;
if([actual isKindOfClass:[NSDictionary class]]) {
for (id key in subset) {
id actualValue = [actual valueForKey:key];
id subsetValue = [subset valueForKey:key];
if (![subsetValue isEqual:actualValue]) return NO;
}
} else {
for (id object in subset) {
if (![actual containsObject:object]) return NO;
}
}
return YES;
});
failureMessageForTo(^NSString *{
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary and does not implement -containsObject:", EXPDescribeObject(actual)];
if(subsetIsNil) return @"the expected value is nil/null";
if(!classMatches) return [NSString stringWithFormat:@"%@ does not match the class of %@", EXPDescribeObject(subset), EXPDescribeObject(actual)];
return [NSString stringWithFormat:@"expected %@ to be a superset of %@", EXPDescribeObject(actual), EXPDescribeObject(subset)];
});
failureMessageForNotTo(^NSString *{
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary and does not implement -containsObject:", EXPDescribeObject(actual)];
if(subsetIsNil) return @"the expected value is nil/null";
if(!classMatches) return [NSString stringWithFormat:@"%@ does not match the class of %@", EXPDescribeObject(subset), EXPDescribeObject(actual)];
return [NSString stringWithFormat:@"expected %@ not to be a superset of %@", EXPDescribeObject(actual), EXPDescribeObject(subset)];
});
}
EXPMatcherImplementationEnd
... ...
#import "Expecta.h"
EXPMatcherInterface(beginWith, (id expected));
#define startWith beginWith
... ...
#import "EXPMatchers+beginWith.h"
EXPMatcherImplementationBegin(beginWith, (id expected)) {
BOOL actualIsNil = (actual == nil);
BOOL expectedIsNil = (expected == nil);
//This condition allows the comparison of an immutable string or ordered collection to the mutable type of the same
BOOL actualAndExpectedAreCompatible = (([actual isKindOfClass:[NSString class]] && [expected isKindOfClass:[NSString class]])
|| ([actual isKindOfClass:[NSArray class]] && [expected isKindOfClass:[NSArray class]])
|| ([actual isKindOfClass:[NSOrderedSet class]] && [expected isKindOfClass:[NSOrderedSet class]]));
prerequisite(^BOOL {
return actualAndExpectedAreCompatible;
});
match(^BOOL {
if ([actual isKindOfClass:[NSString class]]) {
return [actual hasPrefix:expected];
} else if ([actual isKindOfClass:[NSArray class]]) {
if ([expected count] > [actual count] || [expected count] == 0) {
return NO;
}
NSArray *subArray = [actual subarrayWithRange:NSMakeRange(0, [expected count])];
return [subArray isEqualToArray:expected];
} else {
if ([expected count] > [actual count] || [expected count] == 0) {
return NO;
}
NSOrderedSet *subset = [NSOrderedSet orderedSetWithOrderedSet:actual range:NSMakeRange(0, [expected count]) copyItems:NO];
return [subset isEqualToOrderedSet:expected];
}
});
failureMessageForTo(^NSString *{
if (actualIsNil) return @"the object is nil/null";
if (expectedIsNil) return @"the expected value is nil/null";
if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]];
return [NSString stringWithFormat:@"expected: %@ to begin with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)];
});
failureMessageForNotTo(^NSString *{
if (actualIsNil) return @"the object is nil/null";
if (expectedIsNil) return @"the expected value is nil/null";
if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]];
return [NSString stringWithFormat:@"expected: %@ not to begin with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)];
});
}
EXPMatcherImplementationEnd
... ...
... ... @@ -3,25 +3,15 @@
EXPMatcherImplementationBegin(_contain, (id expected)) {
BOOL actualIsCompatible = [actual isKindOfClass:[NSString class]] || [actual conformsToProtocol:@protocol(NSFastEnumeration)];
BOOL expectedIsNil = (expected == nil);
BOOL actualIsDictionary = [actual isKindOfClass:[NSDictionary class]];
BOOL expectedIsDictionary = [expected isKindOfClass:[NSDictionary class]];
BOOL bothOrNeitherDictionaries = (actualIsDictionary && expectedIsDictionary) || (!actualIsDictionary && !expectedIsDictionary);
prerequisite(^BOOL{
return actualIsCompatible && !expectedIsNil && bothOrNeitherDictionaries;
return actualIsCompatible && !expectedIsNil;
});
match(^BOOL{
if(actualIsCompatible) {
if([actual isKindOfClass:[NSString class]]) {
return [(NSString *)actual rangeOfString:[expected description]].location != NSNotFound;
} else if ([actual isKindOfClass:[NSDictionary class]]) {
NSArray *expectedKeys = [expected allKeys];
id notFoundMarker = [NSObject new];
NSArray *expectedValues = [expected objectsForKeys:expectedKeys notFoundMarker:notFoundMarker];
NSArray *actualValues = [actual objectsForKeys:expectedKeys notFoundMarker:notFoundMarker];
[notFoundMarker release];
return [actualValues isEqual:expectedValues];
} else {
for (id object in actual) {
if ([object isEqual:expected]) {
... ... @@ -36,26 +26,12 @@ EXPMatcherImplementationBegin(_contain, (id expected)) {
failureMessageForTo(^NSString *{
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString or NSFastEnumeration", EXPDescribeObject(actual)];
if(expectedIsNil) return @"the expected value is nil/null";
if(!bothOrNeitherDictionaries) {
if (actualIsDictionary) {
return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary", EXPDescribeObject(expected)];
} else {
return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary", EXPDescribeObject(actual)];
}
}
return [NSString stringWithFormat:@"expected %@ to contain %@", EXPDescribeObject(actual), EXPDescribeObject(expected)];
});
failureMessageForNotTo(^NSString *{
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString or NSFastEnumeration", EXPDescribeObject(actual)];
if(expectedIsNil) return @"the expected value is nil/null";
if(!bothOrNeitherDictionaries) {
if (actualIsDictionary) {
return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary", EXPDescribeObject(expected)];
} else {
return [NSString stringWithFormat:@"%@ is not an instance of NSDictionary", EXPDescribeObject(actual)];
}
}
return [NSString stringWithFormat:@"expected %@ not to contain %@", EXPDescribeObject(actual), EXPDescribeObject(expected)];
});
}
... ...
#import "Expecta.h"
EXPMatcherInterface(endWith, (id expected));
... ...
#import "EXPMatchers+endWith.h"
EXPMatcherImplementationBegin(endWith, (id expected)) {
BOOL actualIsNil = (actual == nil);
BOOL expectedIsNil = (expected == nil);
//This condition allows the comparison of an immutable string or ordered collection to the mutable type of the same
BOOL actualAndExpectedAreCompatible = (([actual isKindOfClass:[NSString class]] && [expected isKindOfClass:[NSString class]])
|| ([actual isKindOfClass:[NSArray class]] && [expected isKindOfClass:[NSArray class]])
|| ([actual isKindOfClass:[NSOrderedSet class]] && [expected isKindOfClass:[NSOrderedSet class]]));
prerequisite(^BOOL {
return actualAndExpectedAreCompatible;
});
match(^BOOL {
if ([actual isKindOfClass:[NSString class]]) {
return [actual hasSuffix:expected];
} else if ([actual isKindOfClass:[NSArray class]]) {
if ([expected count] > [actual count] || [expected count] == 0) {
return NO;
}
NSArray *subArray = [actual subarrayWithRange:NSMakeRange([actual count] - [expected count], [expected count])];
return [subArray isEqualToArray:expected];
} else {
if ([expected count] > [actual count] || [expected count] == 0) {
return NO;
}
NSOrderedSet *subset = [NSOrderedSet orderedSetWithOrderedSet:actual range:NSMakeRange([actual count] - [expected count], [expected count]) copyItems:NO];
return [subset isEqualToOrderedSet:expected];
}
});
failureMessageForTo(^NSString *{
if (actualIsNil) return @"the object is nil/null";
if (expectedIsNil) return @"the expected value is nil/null";
if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]];
return [NSString stringWithFormat:@"expected: %@ to end with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)];
});
failureMessageForNotTo(^NSString *{
if (actualIsNil) return @"the object is nil/null";
if (expectedIsNil) return @"the expected value is nil/null";
if (!actualAndExpectedAreCompatible) return [NSString stringWithFormat:@"%@ and %@ are not instances of one of %@, %@, or %@", EXPDescribeObject(actual), EXPDescribeObject(expected), [NSString class], [NSArray class], [NSOrderedSet class]];
return [NSString stringWithFormat:@"expected: %@ not to end with %@", EXPDescribeObject(actual), EXPDescribeObject(expected)];
});
}
EXPMatcherImplementationEnd
... ...
... ... @@ -2,4 +2,4 @@
EXPMatcherInterface(_equal, (id expected));
EXPMatcherInterface(equal, (id expected)); // to aid code completion
#define equal(expected) _equal(EXPObjectify((expected)))
#define equal(...) _equal(EXPObjectify((__VA_ARGS__)))
... ...
#import "EXPMatchers+haveCountOf.h"
EXPMatcherImplementationBegin(haveCountOf, (NSUInteger expected)) {
BOOL actualIsCompatible = [actual isKindOfClass:[NSString class]] || [actual respondsToSelector:@selector(count)];
BOOL actualIsStringy = [actual isKindOfClass:[NSString class]] || [actual isKindOfClass:[NSAttributedString class]];
BOOL actualIsCompatible = actualIsStringy || [actual respondsToSelector:@selector(count)];
prerequisite(^BOOL{
return actualIsCompatible;
});
NSUInteger (^count)(id) = ^(id actual) {
if([actual isKindOfClass:[NSString class]]) {
if(actualIsStringy) {
return [actual length];
} else {
return [actual count];
... ... @@ -23,12 +24,12 @@ EXPMatcherImplementationBegin(haveCountOf, (NSUInteger expected)) {
});
failureMessageForTo(^NSString *{
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)];
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSAttributedString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)];
return [NSString stringWithFormat:@"expected %@ to have a count of %zi but got %zi", EXPDescribeObject(actual), expected, count(actual)];
});
failureMessageForNotTo(^NSString *{
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)];
if(!actualIsCompatible) return [NSString stringWithFormat:@"%@ is not an instance of NSString, NSAttributedString, NSArray, NSSet, NSOrderedSet, or NSDictionary", EXPDescribeObject(actual)];
return [NSString stringWithFormat:@"expected %@ not to have a count of %zi", EXPDescribeObject(actual), expected];
});
}
... ...
#import "Expecta.h"
EXPMatcherInterface(notify, (id expectedNotification));
... ...
#import "EXPMatchers+notify.h"
EXPMatcherImplementationBegin(notify, (id expected)){
BOOL actualIsNil = (actual == nil);
BOOL expectedIsNil = (expected == nil);
BOOL isNotification = [expected isKindOfClass:[NSNotification class]];
BOOL isName = [expected isKindOfClass:[NSString class]];
__block NSString *expectedName;
__block BOOL expectedNotificationOccurred = NO;
__block id observer;
prerequisite(^BOOL{
expectedNotificationOccurred = NO;
if (actualIsNil || expectedIsNil) return NO;
if (isNotification) {
expectedName = [expected name];
}else if(isName) {
expectedName = expected;
}else{
return NO;
}
observer = [[NSNotificationCenter defaultCenter] addObserverForName:expectedName object:nil queue:nil usingBlock:^(NSNotification *note){
if (isNotification) {
expectedNotificationOccurred |= [expected isEqual:note];
}else{
expectedNotificationOccurred = YES;
}
}];
((EXPBasicBlock)actual)();
return YES;
});
match(^BOOL{
if(expectedNotificationOccurred) {
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}
return expectedNotificationOccurred;
});
failureMessageForTo(^NSString *{
if (observer) {
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}
if(actualIsNil) return @"the actual value is nil/null";
if(expectedIsNil) return @"the expected value is nil/null";
if(!(isNotification || isName)) return @"the actual value is not a notification or string";
return [NSString stringWithFormat:@"expected: %@, got: none",expectedName];
});
failureMessageForNotTo(^NSString *{
if (observer) {
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}
if(actualIsNil) return @"the actual value is nil/null";
if(expectedIsNil) return @"the expected value is nil/null";
if(!(isNotification || isName)) return @"the actual value is not a notification or string";
return [NSString stringWithFormat:@"expected: none, got: %@", expectedName];
});
}
EXPMatcherImplementationEnd
... ...
#import "Expecta.h"
EXPMatcherInterface(respondTo, (SEL expected));
... ...
#import "EXPMatchers+respondTo.h"
#import "EXPMatcherHelpers.h"
EXPMatcherImplementationBegin(respondTo, (SEL expected)) {
BOOL actualIsNil = (actual == nil);
BOOL expectedIsNull = (expected == NULL);
prerequisite (^BOOL {
return !(actualIsNil || expectedIsNull);
});
match(^BOOL {
return [actual respondsToSelector:expected];
});
failureMessageForTo(^NSString *{
if (actualIsNil) return @"the object is nil/null";
if (expectedIsNull) return @"the selector is null";
return [NSString stringWithFormat:@"expected: %@ to respond to %@", EXPDescribeObject(actual), NSStringFromSelector(expected)];
});
failureMessageForNotTo(^NSString *{
if (actualIsNil) return @"the object is nil/null";
if (expectedIsNull) return @"the selector is null";
return [NSString stringWithFormat:@"expected: %@ not to respond to %@", EXPDescribeObject(actual), NSStringFromSelector(expected)];
});
}
EXPMatcherImplementationEnd
... ...
... ... @@ -7,6 +7,7 @@
#import "EXPMatchers+beTruthy.h"
#import "EXPMatchers+beFalsy.h"
#import "EXPMatchers+contain.h"
#import "EXPMatchers+beSupersetOf.h"
#import "EXPMatchers+haveCountOf.h"
#import "EXPMatchers+beIdenticalTo.h"
#import "EXPMatchers+beGreaterThan.h"
... ... @@ -17,3 +18,7 @@
#import "EXPMatchers+beCloseTo.h"
#import "EXPMatchers+raise.h"
#import "EXPMatchers+raiseWithReason.h"
#import "EXPMatchers+respondTo.h"
#import "EXPMatchers+notify.h"
#import "EXPMatchers+beginWith.h"
#import "EXPMatchers+endWith.h"
... ...
../../Expecta/src/matchers/EXPMatchers+beSupersetOf.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+beginWith.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+endWith.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+notify.h
\ No newline at end of file
... ...
../../Expecta/src/matchers/EXPMatchers+respondTo.h
\ No newline at end of file
... ...
Pod::Spec.new do |s|
s.name = 'Masonry'
s.version = '0.4.0'
s.version = '0.5.0'
s.license = 'MIT'
s.summary = 'Harness the power of Auto Layout NSLayoutConstraints with a simplified, chainable and expressive syntax.'
s.homepage = 'https://github.com/cloudkite/Masonry'
s.author = { 'Jonas Budelmann' => 'jonas.budelmann@gmail.com' }
s.social_media_url = "http://twitter.com/cloudkite"
s.source = { :git => 'https://github.com/cloudkite/Masonry.git', :tag => 'v0.4.0' }
s.source = { :git => 'https://github.com/cloudkite/Masonry.git', :tag => 'v0.5.0' }
s.description = %{
Masonry is a light-weight layout framework which wraps AutoLayout with a nicer syntax.
... ...
PODS:
- Expecta (0.2.3)
- Masonry (0.4.0)
- Expecta (0.3.0)
- Masonry (0.5.0)
DEPENDENCIES:
- Expecta
... ... @@ -11,7 +11,7 @@ EXTERNAL SOURCES:
:path: ./
SPEC CHECKSUMS:
Expecta: 2434bb2e2b3b1814280ec5d9a11359433d035975
Masonry: d673617c9cbc24aaea90fba20b10e47fd9970a39
Expecta: 322f1dc42610106a5ba9871b4924cf1635d80833
Masonry: bef482b29f00b33a2da916e1011af85f5d371d66
COCOAPODS: 0.32.1
... ...
... ... @@ -9,6 +9,6 @@
// Masonry
#define COCOAPODS_POD_AVAILABLE_Masonry
#define COCOAPODS_VERSION_MAJOR_Masonry 0
#define COCOAPODS_VERSION_MINOR_Masonry 4
#define COCOAPODS_VERSION_MINOR_Masonry 5
#define COCOAPODS_VERSION_PATCH_Masonry 0
... ...
... ... @@ -9,6 +9,6 @@
// Expecta
#define COCOAPODS_POD_AVAILABLE_Expecta
#define COCOAPODS_VERSION_MAJOR_Expecta 0
#define COCOAPODS_VERSION_MINOR_Expecta 2
#define COCOAPODS_VERSION_PATCH_Expecta 3
#define COCOAPODS_VERSION_MINOR_Expecta 3
#define COCOAPODS_VERSION_PATCH_Expecta 0
... ...
... ... @@ -9,6 +9,6 @@
// Masonry
#define COCOAPODS_POD_AVAILABLE_Masonry
#define COCOAPODS_VERSION_MAJOR_Masonry 0
#define COCOAPODS_VERSION_MINOR_Masonry 4
#define COCOAPODS_VERSION_MINOR_Masonry 5
#define COCOAPODS_VERSION_PATCH_Masonry 0
... ...
This diff could not be displayed because it is too large.