Skip to content

Instantly share code, notes, and snippets.

Jon Reid jonreid

Block or report user

Report or block jonreid

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 May 17, 2019
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)'
You can’t perform that action at this time.