This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
beforeEach(^{ | |
// Prepare for a suite of compile errors | |
Car *target = [[[Car alloc] init] autorelease]; | |
mockProperty(target, @"engine"); | |
mockProperty(target, @"brakes"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation Car | |
objection_register(Car) | |
objection_requires(@"engine", @"brakes") | |
@synthesize engine, brakes; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TTURLRequest *urlRequest = [[[TTURLRequest alloc] initWithURL:@"http://www.google.com" delegate:nil] autorelease]; | |
[urlRequest setHttpMethod:@"POST"]; | |
urlRequest.multiPartForm = NO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ExternalUtility | |
+ (void)doSomething; | |
@end | |
@implementation ExternalUtility | |
+ (void)doSomething {...} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@protocol ExternalUtility | |
- (void)doSomething; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface MyModule : ObjectionModule | |
@end | |
@implementation MyModule | |
- (void)configure { | |
[self bindMetaClass:[ExternalUtility class] toProtocol:@protocol(ExternalUtility)]; | |
} | |
@end |