Skip to content

Instantly share code, notes, and snippets.

View jdewind's full-sized avatar

Justin DeWind jdewind

  • LifeWorks
  • Grand Rapids
View GitHub Profile
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}-StaticLib.a" &&
DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}-StaticLib.a" &&
UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal" &&
UNIVERSAL_LIBRARY_PATH="${UNIVERSAL_LIBRARY_DIR}/${PRODUCT_NAME}" &&
FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${PRODUCT_NAME}.framework" &&
# Create framework directory structure.
rm -rf "${FRAMEWORK}" &&
mkdir -p "${UNIVERSAL_LIBRARY_DIR}" &&
mkdir -p "${FRAMEWORK}/Versions/A/Headers" &&
beforeEach(^{
// Prepare for a suite of compile errors
Car *target = [[[Car alloc] init] autorelease];
target.engine = [OCMockObject mockForClass:[Engine class]];
target.brakes = [OCMockObject mockForClass:[Brakes class]]
});
beforeEach(^{
// Prepare for a suite of compile errors
Car *target = [[[Car alloc] init] autorelease];
mockProperty(target, @"engine");
mockProperty(target, @"brakes");
});
id AddToContext(NSString *key, id value) {
[[SpecHelper specHelper].sharedExampleContext setObject:value forKey:key];
return value;
}
NSString * _parseClassOrProtocolName(NSString *propertyName,id target) {
objc_property_t property = class_getProperty([target class], (const char *)[propertyName UTF8String]);
if (!property) {
fail([NSString stringWithFormat:@"Unable to find property '%@ on %@", propertyName, NSStringFromClass([target class])]);
@implementation Car
objection_register(Car)
objection_requires(@"engine", @"brakes")
@synthesize engine, brakes;
@end
TTURLRequest *urlRequest = [[[TTURLRequest alloc] initWithURL:@"http://www.google.com" delegate:nil] autorelease];
[urlRequest setHttpMethod:@"POST"];
urlRequest.multiPartForm = NO;
#import "SpecHelper.h"
SPEC_BEGIN(TTURLRequestSpecs)
it(@"generates a application/x-www-form-urlencoded form body", ^{
TTURLRequest *urlRequest = [[[TTURLRequest alloc] initWithURL:@"http://www.google.com" delegate:nil] autorelease];
[urlRequest setHttpMethod:@"POST"];
urlRequest.multiPartForm = NO;
[urlRequest.parameters setObject:@"Hello World" forKey:@"theKey"];
[urlRequest.parameters setObject:@"I'm Ron Burgundy?" forKey: @"anchorman"];
@interface ExternalUtility
+ (void)doSomething;
@end
@implementation ExternalUtility
+ (void)doSomething {...}
@end
@protocol ExternalUtility
- (void)doSomething;
@end
@interface MyModule : ObjectionModule
@end
@implementation MyModule
- (void)configure {
[self bindMetaClass:[ExternalUtility class] toProtocol:@protocol(ExternalUtility)];
}
@end