Skip to content

Instantly share code, notes, and snippets.

@jonreid
Created October 13, 2011 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonreid/1283431 to your computer and use it in GitHub Desktop.
Save jonreid/1283431 to your computer and use it in GitHub Desktop.
Test using OCHamcrest 1.6 hasProperty matcher
- (void)testArrayFromURLStringArray
{
// given
NSArray *URLStrings = [NSArray arrayWithObjects:@"one", @"two", nil];
// when
NSMutableArray *downloads = [MyDownloader arrayFromURLStringArray:URLStrings];
// then
assertThat(downloads, contains(hasProperty(@"URLString", @"one"),
hasProperty(@"URLString", @"two"),
nil));
}
@jonreid
Copy link
Author

jonreid commented Oct 13, 2011

This is the "after" example. See: Simplify Your Tests with OCHamcrest's "hasProperty" http://jonreid.blogs.com/qualitycoding/2011/10/simplify-your-tests-with-ochamcrests-hasproperty.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment