Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Reid jonreid

View GitHub Profile
@jonreid
jonreid / gist:1283431
Created Oct 13, 2011
Test using OCHamcrest 1.6 hasProperty matcher
View gist:1283431
- (void)testArrayFromURLStringArray
{
// given
NSArray *URLStrings = [NSArray arrayWithObjects:@"one", @"two", nil];
// when
NSMutableArray *downloads = [MyDownloader arrayFromURLStringArray:URLStrings];
// then
assertThat(downloads, contains(hasProperty(@"URLString", @"one"),
@jonreid
jonreid / gist:1283418
Created Oct 13, 2011
Test before OCHamcrest 1.6
View gist:1283418
- (void)testArrayFromURLStringArray
{
// given
NSArray *URLStrings = [NSArray arrayWithObjects:@"one", @"two", nil];
// when
NSMutableArray *downloads = [MyDownloader arrayFromURLStringArray:URLStrings];
// then
assertThat(downloads, hasCountOf(2));
@jonreid
jonreid / gist:1258076
Last active Nov 26, 2020
Terminal command to help you find preprocessor code smells in Objective-C code
View gist:1258076
find . \( \( -name "*.[chm]" -o -name "*.mm" \) -o -name "*.cpp" \) -print0 | xargs -0 egrep -n '^\w*\#' | egrep -v '(import|pragma|else|endif|HC_SHORTHAND|MOCKITO_SHORTHAND)'