cd ~/Library/Developer/Xcode/UserData/CodeSnippets/
git init
git remote add burtlo [email protected]:burtlo/xcode-snippets.git
git pull burtlo master
###Expecta
__block <#class#> *subject;
__block id partialSubject;
beforeEach(^{
subject = [[<#class#> alloc] init];
partialSubject = [OCMockObject partialMockForObject:subject];
});
[[[<#instance#> stub] andReturn:<#data#>] <#method#>:[OCMArg any]];
[[<#instance#> stub] <#method#>];
[[<#subject#> expect] <#method#>:[OCMArg checkWithBlock:^BOOL(id value) {
<#code#>
return NO;
}]];
__block <#class#> <#name#>;
###Cedar
describe(@"<#subject#>", ^{
it(@"should <#behavior#>", ^{
expect(YES).toBeFalsy();
});
});
it(@"should <#behavior#>", ^{
expect(YES).toBeTruthy();
});
afterEach(^{
<#code#>
});
beforeEach(^{
<#code#>
});
###OCMock
<#subject#> = [OCMockObject mockForProtocol:@protocol(<#protocol#>)];
<#subject#> = [OCMockObject mockForClass:[<#class#> class]];
[[[<#instance#> expect] <#method#>];
[[[<#instance#> expect] andReturn:<#data#>] <#method#>:[OCMArg any]];