Commit ce97594c authored by Stefan van den Oord's avatar Stefan van den Oord

Updated Cocoapods

parent 10d5a3c1
......@@ -3,9 +3,9 @@ PODS:
- CocoaAsyncSocket (7.4.1)
- IGDigest (1.1.2)
- lz4 (123)
- Nimble (0.3.0)
- Nimble (0.3.1)
- OpenSSL-Framework (1.0.201)
- Quick (0.2.2)
- Quick (0.2.3)
- SwiftBytes (0.1.0)
DEPENDENCIES:
......@@ -19,13 +19,13 @@ DEPENDENCIES:
- SwiftBytes (~> 0.1.0)
SPEC CHECKSUMS:
Base32: a0ef6e90e721130c474cc970a4d98a6cbf16ce85
CocoaAsyncSocket: b0a1a89e7ea4c1c0ea4ec83f57d55117d3cdae06
IGDigest: b9ff1800bf1f0bdc3714fb4f0f63904464b2ddb4
lz4: 316468bb1b748b046e7d4452e46ffc5c7fddccf0
Nimble: a4d9d978129e83d73e33b7d8bce57443bd556068
Base32: 4e6b6d6c344b48da363c5268f9c391d37893401f
CocoaAsyncSocket: 7cbf214b27f8e7f7574db6a3fd96352ffaed433d
IGDigest: 066753c10f3f1b593b00037b9ee93dc96b9e7762
lz4: 04eccb717fb91bcc7b22868bdb545fdffa27f053
Nimble: 1b3c765852d63b9540a91e528e1e4f8afab79b6f
OpenSSL-Framework: 2d2289869dd1cfd0df0b340398bcf64094ecfe12
Quick: 7b89ff625e72ef931c2a9ef2f25ac3a9d2457763
SwiftBytes: 2f33be5dd47e9cee01aae1ccd54c126ea1ab5a6e
Quick: 2c59914d3b2548a0e8ed0288062d965d9bab03e2
SwiftBytes: e7a808f61a9954ee173e1c3c09d211e3a212c2db
COCOAPODS: 0.36.0
COCOAPODS: 0.36.3
......@@ -3,9 +3,9 @@ PODS:
- CocoaAsyncSocket (7.4.1)
- IGDigest (1.1.2)
- lz4 (123)
- Nimble (0.3.0)
- Nimble (0.3.1)
- OpenSSL-Framework (1.0.201)
- Quick (0.2.2)
- Quick (0.2.3)
- SwiftBytes (0.1.0)
DEPENDENCIES:
......@@ -19,13 +19,13 @@ DEPENDENCIES:
- SwiftBytes (~> 0.1.0)
SPEC CHECKSUMS:
Base32: a0ef6e90e721130c474cc970a4d98a6cbf16ce85
CocoaAsyncSocket: b0a1a89e7ea4c1c0ea4ec83f57d55117d3cdae06
IGDigest: b9ff1800bf1f0bdc3714fb4f0f63904464b2ddb4
lz4: 316468bb1b748b046e7d4452e46ffc5c7fddccf0
Nimble: a4d9d978129e83d73e33b7d8bce57443bd556068
Base32: 4e6b6d6c344b48da363c5268f9c391d37893401f
CocoaAsyncSocket: 7cbf214b27f8e7f7574db6a3fd96352ffaed433d
IGDigest: 066753c10f3f1b593b00037b9ee93dc96b9e7762
lz4: 04eccb717fb91bcc7b22868bdb545fdffa27f053
Nimble: 1b3c765852d63b9540a91e528e1e4f8afab79b6f
OpenSSL-Framework: 2d2289869dd1cfd0df0b340398bcf64094ecfe12
Quick: 7b89ff625e72ef931c2a9ef2f25ac3a9d2457763
SwiftBytes: 2f33be5dd47e9cee01aae1ccd54c126ea1ab5a6e
Quick: 2c59914d3b2548a0e8ed0288062d965d9bab03e2
SwiftBytes: e7a808f61a9954ee173e1c3c09d211e3a212c2db
COCOAPODS: 0.36.0
COCOAPODS: 0.36.3
......@@ -16,7 +16,6 @@ public struct Expression<T> {
internal let _expression: (Bool) -> T?
internal let _withoutCaching: Bool
public let location: SourceLocation
public var cache: T?
public init(expression: () -> T?, location: SourceLocation) {
self._expression = memoizedClosure(expression)
......
......@@ -59,10 +59,21 @@ public func beEmpty() -> NonNilMatcherFunc<NMBCollection> {
}
extension NMBObjCMatcher {
class func beEmptyMatcher() -> NMBObjCMatcher {
public class func beEmptyMatcher() -> NMBObjCMatcher {
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
let expr = actualExpression.cast { $0 as? NMBCollection }
return beEmpty().matches(expr, failureMessage: failureMessage)
let actualValue = actualExpression.evaluate()
failureMessage.postfixMessage = "be empty"
if let value = actualValue as? NMBCollection {
let expr = Expression(expression: ({ value as NMBCollection }), location: location)
return beEmpty().matches(expr, failureMessage: failureMessage)
} else if let value = actualValue as? NSString {
let expr = Expression(expression: ({ value as String }), location: location)
return beEmpty().matches(expr, failureMessage: failureMessage)
} else if let actualValue = actualValue {
failureMessage.postfixMessage = "be empty (only works for NSArrays, NSSets, NSDictionaries, NSHashTables, and NSStrings)"
failureMessage.actualValue = "\(NSStringFromClass(actualValue.dynamicType)) type"
}
return false
}
}
}
......@@ -21,15 +21,21 @@ internal func raiseExceptionMatcher<T>(message: String, matches: (NSException?)
}
}
/// A Nimble matcher that succeeds when the actual expression raises an exception with
/// the specified name, reason, and userInfo.
public func raiseException(#named: String, #reason: String, #userInfo: NSDictionary) -> MatcherFunc<Any> {
return raiseExceptionMatcher("raise exception named <\(named)> with reason <\(reason)> and userInfo <\(userInfo)>") {
exception in
return exception?.name == named
&& exception?.reason == reason
&& exception?.userInfo == userInfo
}
}
/// A Nimble matcher that succeeds when the actual expression raises an exception with
/// the specified name and reason.
public func raiseException(#named: String, #reason: String?) -> MatcherFunc<Any> {
var theReason = ""
if let reason = reason {
theReason = reason
}
return raiseExceptionMatcher("raise exception named <\(named)> and reason <\(theReason)>") {
public func raiseException(#named: String, #reason: String) -> MatcherFunc<Any> {
return raiseExceptionMatcher("raise exception named <\(named)> with reason <\(reason)>") {
exception in return exception?.name == named && exception?.reason == reason
}
}
......@@ -54,16 +60,20 @@ public func raiseException() -> MatcherFunc<Any> {
@objc public class NMBObjCRaiseExceptionMatcher : NMBMatcher {
var _name: String?
var _reason: String?
init(name: String?, reason: String?) {
var _userInfo: NSDictionary?
init(name: String?, reason: String?, userInfo: NSDictionary?) {
_name = name
_reason = reason
_userInfo = userInfo
}
public func matches(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
let block: () -> Any? = ({ actualBlock(); return nil })
let expr = Expression(expression: block, location: location)
if _name != nil && _reason != nil {
return raiseException(named: _name!, reason: _reason).matches(expr, failureMessage: failureMessage)
if _name != nil && _reason != nil && _userInfo != nil {
return raiseException(named: _name!, reason: _reason!, userInfo: _userInfo!).matches(expr, failureMessage: failureMessage)
} else if _name != nil && _reason != nil {
return raiseException(named: _name!, reason: _reason!).matches(expr, failureMessage: failureMessage)
} else if _name != nil {
return raiseException(named: _name!).matches(expr, failureMessage: failureMessage)
} else {
......@@ -75,21 +85,27 @@ public func raiseException() -> MatcherFunc<Any> {
return !matches(actualBlock, failureMessage: failureMessage, location: location)
}
var named: (name: String) -> NMBObjCRaiseExceptionMatcher {
public var named: (name: String) -> NMBObjCRaiseExceptionMatcher {
return ({ name in
return NMBObjCRaiseExceptionMatcher(name: name, reason: self._reason)
return NMBObjCRaiseExceptionMatcher(name: name, reason: self._reason, userInfo: self._userInfo)
})
}
var reason: (reason: String?) -> NMBObjCRaiseExceptionMatcher {
public var reason: (reason: String?) -> NMBObjCRaiseExceptionMatcher {
return ({ reason in
return NMBObjCRaiseExceptionMatcher(name: self._name, reason: reason)
return NMBObjCRaiseExceptionMatcher(name: self._name, reason: reason, userInfo: self._userInfo)
})
}
public var userInfo: (userInfo: NSDictionary?) -> NMBObjCRaiseExceptionMatcher {
return ({ userInfo in
return NMBObjCRaiseExceptionMatcher(name: self._name, reason: self._reason, userInfo: userInfo)
})
}
}
extension NMBObjCMatcher {
public class func raiseExceptionMatcher() -> NMBObjCRaiseExceptionMatcher {
return NMBObjCRaiseExceptionMatcher(name: nil, reason: nil)
return NMBObjCRaiseExceptionMatcher(name: nil, reason: nil, userInfo: nil)
}
}
......@@ -76,6 +76,10 @@ NIMBLE_EXPORT id<NMBMatcher> NMB_beNil(void);
NIMBLE_SHORT(id<NMBMatcher> beNil(void),
NMB_beNil());
NIMBLE_EXPORT id<NMBMatcher> NMB_beEmpty(void);
NIMBLE_SHORT(id<NMBMatcher> beEmpty(void),
NMB_beEmpty());
NIMBLE_EXPORT id<NMBMatcher> NMB_contain(id itemOrSubstring);
NIMBLE_SHORT(id<NMBMatcher> contain(id itemOrSubstring),
NMB_contain(itemOrSubstring));
......@@ -105,8 +109,8 @@ NIMBLE_EXPORT NMBWaitUntilBlock nmb_wait_until_builder(NSString *file, NSUIntege
#define NMB_waitUntil nmb_wait_until_builder(@(__FILE__), __LINE__)
#ifndef NIMBLE_DISABLE_SHORT_SYNTAX
#define expect(EXPR) NMB_expect(^id{ return (EXPR); }, __FILE__, __LINE__)
#define expectAction(EXPR) NMB_expect(^id{ (EXPR); return nil; }, __FILE__, __LINE__)
#define expect(...) NMB_expect(^id{ return (__VA_ARGS__); }, __FILE__, __LINE__)
#define expectAction(...) NMB_expect(^id{ (__VA_ARGS__); return nil; }, __FILE__, __LINE__)
#define waitUntilTimeout NMB_waitUntilTimeout
#define waitUntil NMB_waitUntil
#endif
......@@ -64,6 +64,10 @@ NIMBLE_EXPORT id<NMBMatcher> NMB_beNil() {
return [NMBObjCMatcher beNilMatcher];
}
NIMBLE_EXPORT id<NMBMatcher> NMB_beEmpty() {
return [NMBObjCMatcher beEmptyMatcher];
}
NIMBLE_EXPORT id<NMBMatcher> NMB_contain(id itemOrSubstring) {
return [NMBObjCMatcher containMatcher:itemOrSubstring];
}
......
......@@ -172,12 +172,22 @@ exception once evaluated:
// Note: Swift currently doesn't have exceptions.
// Only Objective-C code can raise exceptions
/ that Nimble will catch.
// that Nimble will catch.
let exception = NSException(
name: NSInternalInconsistencyException,
reason: "Not enough fish in the sea.",
userInfo: nil)
userInfo: ["something": "is fishy"])
expect(exception.raise()).to(raiseException())
// Also, you can customize raiseException to be more specific
expect(exception.raise()).to(raiseException(named: NSInternalInconsistencyException))
expect(exception.raise()).to(raiseException(
named: NSInternalInconsistencyException,
reason: "Not enough fish in the sea"))
expect(exception.raise()).to(raiseException(
named: NSInternalInconsistencyException,
reason: "Not enough fish in the sea",
userInfo: ["something": "is fishy"]))
```
Objective-C works the same way, but you must use the `expectAction`
......@@ -191,6 +201,16 @@ NSException *exception = [NSException exceptionWithName:NSInternalInconsistencyE
reason:@"Not enough fish in the sea."
userInfo:nil];
expectAction([exception raise]).to(raiseException());
// Use the property-block syntax to be more specific.
expectAction([exception raise]).to(raiseException().named(NSInternalInconsistencyException));
expectAction([exception raise]).to(raiseException().
named(NSInternalInconsistencyException).
reason("Not enough fish in the sea"));
expectAction([exception raise]).to(raiseException().
named(NSInternalInconsistencyException).
reason("Not enough fish in the sea").
userInfo(@{@"something": @"is fishy"}));
```
In Swift, the `expect` function can also take a trailing closure:
......
This diff is collapsed.
......@@ -205,7 +205,7 @@ static inline void fcontext(NSString *description, QCKDSLEmptyBlock closure) {
#define qck_fitBehavesLike qck_itBehavesLike_builder(@{Filter.focused: @YES}, @(__FILE__), __LINE__)
typedef void (^QCKItBlock)(NSString *description, QCKDSLEmptyBlock closure);
typedef void (^QCKItBehavesLikeBlock)(NSString *descritpion, QCKDSLSharedExampleContext context);
typedef void (^QCKItBehavesLikeBlock)(NSString *description, QCKDSLSharedExampleContext context);
extern QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line);
extern QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line);
......@@ -95,6 +95,6 @@ extension World {
}
public func pending(description: String, closure: () -> ()) {
NSLog("Pending: %@", description)
println("Pending: \(description)")
}
}
This diff is collapsed.
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.3.0</string>
<string>0.3.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.2.2</string>
<string>0.2.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -28,7 +28,7 @@
#define COCOAPODS_POD_AVAILABLE_Nimble
#define COCOAPODS_VERSION_MAJOR_Nimble 0
#define COCOAPODS_VERSION_MINOR_Nimble 3
#define COCOAPODS_VERSION_PATCH_Nimble 0
#define COCOAPODS_VERSION_PATCH_Nimble 1
// OpenSSL-Framework
#define COCOAPODS_POD_AVAILABLE_OpenSSL_Framework
......@@ -40,7 +40,7 @@
#define COCOAPODS_POD_AVAILABLE_Quick
#define COCOAPODS_VERSION_MAJOR_Quick 0
#define COCOAPODS_VERSION_MINOR_Quick 2
#define COCOAPODS_VERSION_PATCH_Quick 2
#define COCOAPODS_VERSION_PATCH_Quick 3
// SwiftBytes
#define COCOAPODS_POD_AVAILABLE_SwiftBytes
......
......@@ -38,7 +38,7 @@ install_resource()
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
XCASSET_FILES="$XCASSET_FILES '$1'"
XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'"
;;
/*)
echo "$1"
......@@ -57,7 +57,7 @@ if [[ "${ACTION}" == "install" ]]; then
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n $XCASSET_FILES ]
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
......@@ -73,5 +73,6 @@ then
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT")
echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.3.0</string>
<string>0.3.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.2.2</string>
<string>0.2.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -28,7 +28,7 @@
#define COCOAPODS_POD_AVAILABLE_Nimble
#define COCOAPODS_VERSION_MAJOR_Nimble 0
#define COCOAPODS_VERSION_MINOR_Nimble 3
#define COCOAPODS_VERSION_PATCH_Nimble 0
#define COCOAPODS_VERSION_PATCH_Nimble 1
// OpenSSL-Framework
#define COCOAPODS_POD_AVAILABLE_OpenSSL_Framework
......@@ -40,7 +40,7 @@
#define COCOAPODS_POD_AVAILABLE_Quick
#define COCOAPODS_VERSION_MAJOR_Quick 0
#define COCOAPODS_VERSION_MINOR_Quick 2
#define COCOAPODS_VERSION_PATCH_Quick 2
#define COCOAPODS_VERSION_PATCH_Quick 3
// SwiftBytes
#define COCOAPODS_POD_AVAILABLE_SwiftBytes
......
......@@ -38,7 +38,7 @@ install_resource()
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
XCASSET_FILES="$XCASSET_FILES '$1'"
XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'"
;;
/*)
echo "$1"
......@@ -57,7 +57,7 @@ if [[ "${ACTION}" == "install" ]]; then
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n $XCASSET_FILES ]
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
......@@ -73,5 +73,6 @@ then
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT")
echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
......@@ -38,7 +38,7 @@ install_resource()
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
*.xcassets)
XCASSET_FILES="$XCASSET_FILES '$1'"
XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'"
;;
/*)
echo "$1"
......@@ -57,7 +57,7 @@ if [[ "${ACTION}" == "install" ]]; then
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n $XCASSET_FILES ]
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
......@@ -73,5 +73,6 @@ then
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT")
echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment