Skip to content

Instantly share code, notes, and snippets.

View nicktoumpelis's full-sized avatar
🎯
Focusing

Nick Toumpelis nicktoumpelis

🎯
Focusing
View GitHub Profile
@nicktoumpelis
nicktoumpelis / KlassSpec.m
Created August 13, 2014 09:34
Kiwi Spec Template
#import "Kiwi.h"
static NSTimeInterval const kAsynchronousTestingTimeout = 2.0;
SPEC_BEGIN(KlassSpec)
describe(@"An object", ^{
context(@"when...", ^{
__block Klass *object = nil;
beforeAll(^{ // or 'beforeEach', depending on your needs
@nicktoumpelis
nicktoumpelis / Class.m
Created August 13, 2014 09:16
KVO observation done right
static void * const kKVOContext = (void *)&kKVOContext;
@implementation Class
- (void)someMethod {
[super someMethod];
[observedObject addObserver:self
forKeyPath:@"keyPath"
options:NSKeyValueObservingOptionInitial
context:kKVOContext];