You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@interface NSObject (Category)
-(void)doSomethingWith:(NSString*)str;
@end
@implementation NSObject (Category)
- (void)doSomethingWith:(NSString *)str {
NSLog(@"%@", str);
}
@end
SPEC_BEGIN(NSObjectCategory)
describe(@"NSObjectCategory", ^{
it(@"does receive the real message but this test fails ", ^{
id mock = [NSObject mock];
[[[mock should] receive] doSomethingWith:@"string"];
[mock doSomethingWith:@"string"];
});
});
SPEC_END
stubbing -doSomethingWith: doesn't work neither, the real method is called. This behavior seems wrong, especially considering that if I change id mock = [NSObject mock]; to id obj = [NSObject new]; the test succeeds.
The text was updated successfully, but these errors were encountered:
The following test fails
stub
bing-doSomethingWith:
doesn't work neither, the real method is called. This behavior seems wrong, especially considering that if I changeid mock = [NSObject mock];
toid obj = [NSObject new];
the test succeeds.The text was updated successfully, but these errors were encountered: