I had some problems with mocking protocols as well. In the general case, OCMock is happy to handle blocks arguments:
// Foo
+ (void)blockTest
{
[UIView animateWithDuration:10.0 animations:^{
[[[[UIApplication sharedApplication] windows][0] rootViewController] view].alpha = 0.5;
}];
}
// Test -- this works fine!
- (void)testBlock
{
id viewMock = [OCMockObject mockForClass:UIView.class];
[[viewMock expect] animateWithDuration:10.0 animations:OCMOCK_ANY];
[Foo blockTest];
[viewMock verify];
}
To get around issues with protocol mocking, I create a dummy class that implements the protocol (with empty methods), then mock the methods of this class and use it like any other mock object.