Skip to content

Instantly share code, notes, and snippets.

@jonreid
Created October 13, 2011 04:52
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/1283418 to your computer and use it in GitHub Desktop.
Save jonreid/1283418 to your computer and use it in GitHub Desktop.
Test before OCHamcrest 1.6
- (void)testArrayFromURLStringArray
{
// given
NSArray *URLStrings = [NSArray arrayWithObjects:@"one", @"two", nil];
// when
NSMutableArray *downloads = [MyDownloader arrayFromURLStringArray:URLStrings];
// then
assertThat(downloads, hasCountOf(2));
MyDownloader *download = [downloads objectAtIndex:0];
assertThat([image URLString], is(@"one"));
download = [downloads objectAtIndex:1];
assertThat([image URLString], is(@"two"));
}
@jonreid
Copy link
Author

jonreid commented Oct 13, 2011

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

@wilsolutions
Copy link

are u on XCTest now?

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