Ios 猕猴桃存根是';与NSNumber一起工作,以SIGKILL结束
我不确定我是否做得对,但我正在尝试在核心数据对象上存根NSNumber属性 下面是我的测试示例:Ios 猕猴桃存根是';与NSNumber一起工作,以SIGKILL结束,ios,objective-c,tdd,kiwi,Ios,Objective C,Tdd,Kiwi,我不确定我是否做得对,但我正在尝试在核心数据对象上存根NSNumber属性 下面是我的测试示例: it(@"should say 1 / ? with 1 point", ^{ mockCard = [KWMock nullMockForClass:[Card class]]; [mockCard stub:@selector(points) andReturn:[NSNumber numberWithInt:1]];
it(@"should say 1 / ? with 1 point", ^{
mockCard = [KWMock nullMockForClass:[Card class]];
[mockCard stub:@selector(points) andReturn:[NSNumber numberWithInt:1]];
controller.card = mockCard;
[[controller.lblCount.text should] equal:@"1 / ?"];
});
和我的源代码:
-(void)setCard:(Card *)aCard{
if ([card.points intValue] == 1) {
lblCount.text = @"1 / ?";
}
}
运行此操作会导致writeObjectValueToInvocationReturnValue
方法中出现SIGKIL
错误
我错过什么了吗
更新
试图将存根更改为:
[mockCard stub:@selector(points) andReturn:theValue(1)]
...
[FAILED], wrapped stub value type (i) could not be converted to the target type (v)
这是Kiwi中的一个bug,如下所述:404,这就是为什么你不应该只发布链接。github repo已被移动:问题现在位于: