Skip to content

Commit

Permalink
Partial fix for #328.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdoe committed Oct 22, 2018
1 parent 44ee441 commit 0b809a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/OCMock/OCClassMockObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ - (void)prepareClassForClassMethodMocking
}];
}


- (void)setupForwarderForClassMethodSelector:(SEL)selector
{
SEL aliasSelector = OCMAliasForOriginalSelector(selector);
Expand All @@ -157,8 +158,8 @@ - (void)setupForwarderForClassMethodSelector:(SEL)selector

Class metaClass = object_getClass(mockedClass);
IMP forwarderIMP = [originalMetaClass instanceMethodForwarderForSelector:selector];
class_replaceMethod(metaClass, selector, forwarderIMP, types);
class_addMethod(metaClass, aliasSelector, originalIMP, types);
class_replaceMethod(metaClass, selector, forwarderIMP, types);
}


Expand Down

0 comments on commit 0b809a5

Please sign in to comment.