erikdoe / ocmock

Mock objects for Objective-C
http://ocmock.org
Apache License 2.0
2.16k stars 606 forks source link

Crash in OCObserverMockObject. #316

Closed dsimchenko closed 7 years ago

dsimchenko commented 8 years ago

In OCObserverMockObject.m there is implementation only for

- (NSNotification *)notificationWithName:(NSString *)name object:(id)sender
{
    return [[self expect] notificationWithName:name object:sender];
}

and implementation for - (NSNotification *)notificationWithName:(NSString *)name object:(id)sender userInfo:(NSDictionary *)userInfo is missing.

So there's crash: "caught "NSInvalidArgumentException", "-[OCObserverMockObject notificationWithName:object:userInfo:]: unrecognized selector sent to instance"

when I try to use OCMExpect(([observerMock notificationWithName:DidUpdateProductList object:manager userInfo:@{@"a": @"b"}]));

erikdoe commented 7 years ago

Should be fixed now.