Testing the same code with different input data

I would like to get an advice regarding how to test the same code with different input data.

I would like to test that method operationSucceeded will be invoked for all successful status codes. Here is how I can test (with Kiwi) single status code (i.e. 200):

it(@"should call operationSucceeded", ^{
MKNetworkOperation *op =[[MKNetworkOperation alloc] initWithURLString:@"http://example.com/api" params:nil httpMethod:@"GET"];
[op stub:@selector(notifyCache)];
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:nil
statusCode:200
HTTPVersion:nil
[op stub:@selector(response) andReturn:response];
});


For now I do next:

it(@"should call operationSucceeded", ^{
NSArray *successCodes = @[@200, @201, @202, @203, @204, @205, @206];
for (NSNumber *statusCode in successCodes) {
MKNetworkOperation *op =[[MKNetworkOperation alloc] initWithURLString:@"http://example.com/api" params:nil httpMethod:@"GET"];
[op stub:@selector(notifyCache)];
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:nil
statusCode:[statusCode intValue]
HTTPVersion:nil
[op stub:@selector(response) andReturn:response];
}
});


But the main problem here is that if my test fail for one of status codes it will say something like: "'Operation, should call operationSucceeded' [FAILED], expected subject to receive -operationSucceeded exactly 1 time, but received it 0 times" which is not very useful.

You can find full source code here.

Any advices are very welcome! =)

-
This site is dedicated for code review: you can present working code and ask for possible improvements. However if the code is faulty it isn't in the scope of this site and you should post it on stackoverflow. Also the audience over there is much bigger. – vikingosegundo Jan 7 '13 at 14:35
but this code is working. I just want to improve it to provide better error explanation. This code isn't faulty. – yas375 Jan 7 '13 at 14:51
than you should work on the question's text, as I understood as if it isnt doing what you expect. probably others will misread it as-well. – vikingosegundo Jan 7 '13 at 14:52
@vikingosegundo do you have any thoughts regarding the question itself? – yas375 Jan 7 '13 at 15:00
Nope, I never worked with Kiwi. But sure I will try it out soon. +1 – vikingosegundo Jan 7 '13 at 15:02

I've got one possible solution from Max Lunin:

NSArray *successCodes = @[@200, @201, @202, @203, @204, @205, @206];
for (NSNumber *statusCode in successCodes) {
it([NSString stringWithFormat:@"should call operationSucceeded for status code %@", statusCode], ^{
MKNetworkOperation *op =[[MKNetworkOperation alloc] initWithURLString:@"http://example.com/api" params:nil httpMethod:@"GET"];
[op stub:@selector(notifyCache)];
NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:nil
statusCode:[statusCode intValue]
HTTPVersion:nil

It solves the problem with error explanation. It will tell something like: 'Operation, should call operationSucceeded for status code 202' [FAILED], expected subject to receive -operationSucceeded exactly 1 time, but received it 0 times