gpt4 book ai didi

ios - Kiwi stub 不适用于 NSNumber,以 SIGKILL 结尾

转载 作者:行者123 更新时间:2023-11-28 17:55:37 25 4
gpt4 key购买 nike

我不确定我做的是否正确,但我正在尝试在核心数据对象上添加一个 NSNumber 属性。

这是我的测试示例:

   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 错误。

我错过了什么吗?

更新

试图将 stub 更改为:

[mockCard stub:@selector(points) andReturn:theValue(1)]
...

[FAILED], wrapped stub value type (i) could not be converted to the target type (v)

最佳答案

这是 Kiwi 中的错误,在此处进行了描述:https://github.com/allending/Kiwi/issues/63

关于ios - Kiwi stub 不适用于 NSNumber,以 SIGKILL 结尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7651170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com